RaunLGoode
Registered User.
- Local time
- Today, 15:55
- Joined
- Feb 18, 2004
- Messages
- 122
I want to start in Workbook "BookA"
Save the name of " BookA" as variable "wbA"
Activate Workbook "BookB"
and return to Workbook "BookA"
I am using the following code in workbook
'( from Workbook "BookA" )
Sub AtoBtoA ()
Dim wbA as String
' Set variable to Active workbook name minus the file extension
wbA = Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4)
'go to "BookB"
Windodows("BookB").Activate
' return to original workbook ("BookA") THE NEXT LINE IS WHERE IT HANGS UP with a RunTime Error 9 "Subscript out of Range" error message
Windows(wbA).Activate
' etc
End Sub
Could somebody out there tell what I should using instead of the "Windows(wbA).Activate" and also why this doesn't work.
I have also tried "Workbooks(wbA).Activate" and get the same result
Save the name of " BookA" as variable "wbA"
Activate Workbook "BookB"
and return to Workbook "BookA"
I am using the following code in workbook
'( from Workbook "BookA" )
Sub AtoBtoA ()
Dim wbA as String
' Set variable to Active workbook name minus the file extension
wbA = Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4)
'go to "BookB"
Windodows("BookB").Activate
' return to original workbook ("BookA") THE NEXT LINE IS WHERE IT HANGS UP with a RunTime Error 9 "Subscript out of Range" error message
Windows(wbA).Activate
' etc
End Sub
Could somebody out there tell what I should using instead of the "Windows(wbA).Activate" and also why this doesn't work.
I have also tried "Workbooks(wbA).Activate" and get the same result
Last edited: