Excel copy after problem
That should work. Just to be sure, are you setting nsheets using:
nsheets = Sheets.Count
wrote in message
oups.com...
I have a workbook with 8 sheets, and am trying to copy one of them to
the end of the workbook, using the code below:
Sheets("TR_template").Copy After:=Sheets(nsheets) 'for some reason
after is ignored
The sheet I am copying, "TR_template" is the second sheet. "nsheets"
is set to the number of sheets in the workbook (8). After the copy is
executed, the new sheet, "TR_template (2)" is inserted immediately
after "TR_template", in position 3. Why isn't it number 9? It
appears that the "after" parameter is ignored.
|