I have been using the syntax "Sheets(1)" and "Sheets(2)" just in case their worksheet names changes.
The code snippet below copies values from sheet 1 to sheet 2.
I noticed in Excel 2016 that when I add a new sheet, it copies values to this new sheet, not the original "Sheets(2)".
How can it work without specifying the name of the sheet?
![]()
Do Until RowNumber = 1000 Sheets(2).Cells(RowNumber, 1) = Sheets(1).Cells(RowNumber, 1) RowNumber = RowNumber + 1 Loop
Bookmarks