I am working on a current workbook in Excel. In the VBA, I have done the following :
Sheets("Upload File").Select
Cells.Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
So now, "Book1" is the new workbook. Once I've done what I need to do on there, I need to it then activate the original workbook, the one where I have all the VBA etc.
I close "Book1" with :
ActiveWindow.Close
But then in the next Sub in a process, I can't call any of the sheets within the active workbook :
Sheets("Upload File").Range("A1:AB65536").ClearContents
as i get a "Subscript Out Of Range" error due to the Workbook that "Upload File" sits in not actually being activated again.
Thank you for taking the time to look at this.