Subscript out of range - coping specific sheets to new workbook

mssbass

Active Member
Joined
Nov 14, 2002
Messages
253
Platform
  1. Windows
This was running but all the sudden, I'm getting a subscript out of range error at this last line?

Dim wbO As Workbook, wbN As Workbook

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.DisplayAlerts = False

Set wbO = ActiveWorkbook
Set wbN = Workbooks.Add

wbO.Sheets("Exceptions").Copy wbN.Sheets(1)
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
What is the code name for that sheet?
If you look in the project window of the VB Editor you will see something like
Sheet codenames.png

What is the name before the brackets?
 
Upvote 0
Ok what happens if you try
VBA Code:
Sheet1.Copy wbN.Sheets(1)
 
Upvote 0
Solution
No idea, it's possible the sheet has become corrupted. I've never encountered that error before, so searched the net & found a number of posts where using the code name worked.
 
Upvote 0
No idea, it's possible the sheet has become corrupted. I've never encountered that error before, so searched the net & found a number of posts where using the code name worked.
You're awesome!! Thanks for digging in and helping me through:)
 
Upvote 0

Forum statistics

Threads
1,214,921
Messages
6,122,280
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top