If Microsoft Excel, you can use the
Copy and
Move methods within a Visual Basic macro to copy or move sheets within a single workbook or to another workbook. You can also copy or move sheets by clicking
Move or Copy Sheet on the
Edit menu.
In versions of Microsoft Excel earlier than Excel 97, you can copy or move a sheet after the other sheets in the workbook programmatically by using one of the following commands in a macro:
Sheets("Sheetname").Copy After:=Sheets(Sheets.Count)
-or-
Sheets("Sheetname").Move After:=Sheets(Sheets.Count)
In Microsoft Excel 2000, if you run a macro that contains either of these
commands, and the last sheet in the workbook is hidden, the copied or moved
sheet is not inserted at the end of the workbook. Instead, the sheet is
moved to the right of the last visible sheet in the workbook.
The same behavior applies if you click
Move or Copy Sheet on the
Edit menu, click
(move to end) and then click
OK. In Microsoft Excel 2000, the copied or moved sheet is moved to the right of the last visible sheet in the workbook. In versions of Microsoft Excel earlier than Excel 97, the copied or moved
sheet is moved to the end of the workbook.