Steve Belsch
04-21-2020, 09:27 AM
VBA Experts,
I am running the following code:
'Delete all sheets except PD & Functions
Windows(File_Upload).Activate
Application.DisplayAlerts = False
For Each ws In Worksheets
If ws.Name <> Tab1 And ws.Name <> Tab2 And ws.Name <> Tab3 Then ws.Delete
Next
There are only three worksheets, but yet I am getting this error message and it is stopping at ws.Delete
Run-time-erro '9':
Sbuscript out of range
Any thoughts?
Thanks.
Steve
I am running the following code:
'Delete all sheets except PD & Functions
Windows(File_Upload).Activate
Application.DisplayAlerts = False
For Each ws In Worksheets
If ws.Name <> Tab1 And ws.Name <> Tab2 And ws.Name <> Tab3 Then ws.Delete
Next
There are only three worksheets, but yet I am getting this error message and it is stopping at ws.Delete
Run-time-erro '9':
Sbuscript out of range
Any thoughts?
Thanks.
Steve