Information générale
Catégorie:
COM/DCOM et OLE Automation
>Thanks for the reply. I am not sure this will work for me as:
>I do not know the range in advance
>and I have 1 sheet that I will have to replicate n times
>
>..which is why I was trying to use the
>.Sheets("Page 01").Copy('After')=.Sheets(x)
>which will do what I want, only I seem to be running into syntax problems...
>
The issue is that the Copy method expects one of two parameters in this case: either the sheet to put the new sheet before or the sheet to put it after. That is, the syntax for copying a whole sheet is:
oSheetToCopy.Copy( oSheetBefore , oSheetAfter )
with the limitation that you specify either oSheetBefore or oSheetAfter, but not both. So the correct syntax for the command you're trying is:
.Sheets["Page 01"].Copy(, .Sheets[x])
Hope this helps.
Tamar
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement