Run-time 9 Error

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

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
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,223,909
Messages
6,175,314
Members
452,634
Latest member
cpostell

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