Hi all,
I am running a vba that copies from other workbooks and pastes into ThisWorkbook with offsets etc. There are 10 workbooks altogether and at the end of each run the vba is coded to return each workbook to "Sheet1". My problem is that the returning to Sheet1 works in 9 of the workbooks but does not work in the tenth. I took just that piece of code and pasted it into a module on the offending workbook and tried running it separately but it still does not work, yet works in the others.
This is the code (which I actually got from somewhere on this forum if I recall correctly):
Sub GoToFirstSheet()
On Error Resume Next
Sheets(1).Select
End Sub
But somehow I think the problem must be in the book itself. What could stop a book from running such a code without errors etc.?
Thanks in advance.
I am running a vba that copies from other workbooks and pastes into ThisWorkbook with offsets etc. There are 10 workbooks altogether and at the end of each run the vba is coded to return each workbook to "Sheet1". My problem is that the returning to Sheet1 works in 9 of the workbooks but does not work in the tenth. I took just that piece of code and pasted it into a module on the offending workbook and tried running it separately but it still does not work, yet works in the others.
This is the code (which I actually got from somewhere on this forum if I recall correctly):
Sub GoToFirstSheet()
On Error Resume Next
Sheets(1).Select
End Sub
But somehow I think the problem must be in the book itself. What could stop a book from running such a code without errors etc.?
Thanks in advance.