Jacobshavn
Thank you for the reply. I've tested the code given, but it still jumps back to the previous sheet.
Let me be more precise with my problem. I'm actually jumping between workbooks. Here is a simplified example of my code:
Dim OldBook As String
Dim NewBook As String
Dim ControlPoint As String
'both workbooks are already open
OldBook = "MyOldBook.xlsm"
NewBook = "MyNewBook.xlsm"
Workbooks(OldBook).Activate
Range("MyRange").Select '<-this is cell A5, named as "MyRange" on Sheet1 in OldBook
ControlPoint = ActiveCell.Address '<-could this be done differently?
Workbooks(NewBook).Activate
Sheets.Add.Name = "NewSheet"
Sheets("NewSheet").Activate
Range(Range("MyRange").Address).Select
After this last line it still selects "MyRange" in OldBook, instead of the same address in NewBook, even though NewBook is the active book.
The reason I want need to do this is because I need to give the same range name to cell A5 in NewBook. I therefore need to select it using code. Once I'm on it it's easy to name it.
Thank you for your help!
Bookmarks