summaryrefslogtreecommitdiff
path: root/sc/source/ui/vba/vbaworksheets.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/vba/vbaworksheets.cxx')
-rw-r--r--sc/source/ui/vba/vbaworksheets.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx
index 80b6537d865c..e2c436b13966 100644
--- a/sc/source/ui/vba/vbaworksheets.cxx
+++ b/sc/source/ui/vba/vbaworksheets.cxx
@@ -447,8 +447,12 @@ ScVbaWorksheets::Copy ( const uno::Any& Before, const uno::Any& After) throw (cs
xSheet = pSrcSheet->createSheetCopyInNewDoc(xSrcSheet->getName());
nItem = 1;
}
+ else
+ {
+ nItem=0;
+ }
- for (nItem = 0; nItem < nElems; ++nItem )
+ for (; nItem < nElems; ++nItem )
{
xSrcSheet = Sheets[nItem];
ScVbaWorksheet* pSrcSheet = excel::getImplFromDocModuleWrapper<ScVbaWorksheet>( xSrcSheet );