dhill0502

New Member
Joined
Apr 10, 2019
Messages
6
For the life of my I cannot figure out why the following line of code is giving me a "Run-time error '9': Subscript out of range" Error.

Workbooks("Lookup").Worksheets("Sheet1").Range("A1:BK2000").Copy Destination:=Workbooks("EstimateChecker").Worksheets("estsheet").Range("A1:BK2000")

I am trying to copy sheet1 from the workbook Lookup into the sheet estsheet in the EstimateChecker workbook. Any help would be appreciated.
 
Shouldn't the Estimate workbook be xlsm rather than xls?
 
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
It should be .xlsm yes. However, changing that to xlsm did not get me any different results. Based on your tests you recommended earlier running Workbooks("Lookup.xlsm").activate gives me the same error as before.
 
Upvote 0
In that case I'm not quite sure what is happening.
One possible workaround, would be to ensure that the Lookup workbook is the active workbook when you run the code & use something like
Code:
   Dim Wbk As Workbook
   
   Set Wbk = ActiveWorkbook
   Wbk.Worksheets("Sheet1").Range("A1:BK2000").Copy Destination:=Workbooks("EstimateChecker.xlsm").Worksheets("estsheet").Range("A1:BK2000")
 
Upvote 0

Forum statistics

Threads
1,215,634
Messages
6,125,934
Members
449,275
Latest member
jacob_mcbride

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