how to refer to a non active workbook in VBA???

Mav93

Board Regular
Joined
Feb 21, 2005
Messages
107
Hi everyone !!!!!
is there a way to refer to a non active workbook
I know this code isn't correct but may you can get the idea

Active workbook("Olson Bros Bid Information Sheet.xls").sheets("data").range("A1").value = NonActive workbook("take off forms")Sheets("cost sheet").range("A1")


please let me know if I'm way off I'm still pretty new to VBA
thanks for the help!!!!
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Just change Workbook to Workbooks.
Code:
Workbooks("Olson Bros Bid Information Sheet.xls").sheets("data").range("A1").Value = Workbooks("take off forms")Sheets("cost sheet").range("A1")
 
Upvote 0
Hello Mav93
There are a couple ways to do that. Norie has pointed out the most common
and (in my opinion) the best.
To do it using ActiveWorkbook though you could use this.
Code:
ActiveWorkbook.Sheets("data").Range("A1").Value = _
  Workbooks("take off forms").Sheets("cost sheet").Range("A1").Value
 
Upvote 0
Thanks half ace and norie actually I ended up using both of the codes that you provided.


Thanks again
 
Upvote 0

Forum statistics

Threads
1,217,347
Messages
6,136,046
Members
449,983
Latest member
mschaef6

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