VBA code to read/write in Addtl workbook

StanSz

Board Regular
Joined
Sep 18, 2004
Messages
199
I've got a workbook ("Main" workbook) in which I do a series of calculations -- no problem.

On one worksheet of this Main workbook I want to enter in a Cell the Name of another Workbook, ("Addtl workbook name) and in an adjoining cell the name of a Worksheet in this other workbook. I want to access these cell references via VBA code to enable me to both read and write into several cells on that indicated worksheet in the "Addtl" workbook.

I'd prefer to not change the Active worksheet from the "Main" workbook, so that I'm sure of getting back where I want to be after the few reading and writing work in the Additional workbook.

Entering the Addtl Workbook name and worksheet name in cells would allow me to easily change the names as desired and yet be sure that the VBA code continues to work since the code would be getting the names (path) by reading the cells.

I'm getting very confused in trying to write the VBA code.

Any comments or suggestions.

Thanks

Stansz
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

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