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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
In that case you don't have a sheet called "Exceptions" in that workbook.
 
Upvote 0
In that case you don't have a sheet called "Exceptions" in that workbook.
I have a worksheet called "Exceptions" in my active workbook? I've double-checked and there are no spaces after the name as well. This code was working and now decided not to work?
 
Upvote 0
Any spaces before the name?
 
Upvote 0
Are you sure your looking at the correct workbook?
 
Upvote 0
My workbook that contains the VBA is called Merged_Closed_Template.xlsm - Within this workbook are several tabs - one is called "Exceptions". I'm trying to open a brand new workbook, copy the Exceptions worksheet from Merged_Closed_Template.xlsm to a brand new workbook.
 
Upvote 0
In that case use
VBA Code:
Set wbO = ThisWorkbook
 
Upvote 0

Forum statistics

Threads
1,215,467
Messages
6,124,984
Members
449,201
Latest member
Lunzwe73

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