Cell content into VBA code

CHSLax60

New Member
Joined
Jun 6, 2011
Messages
15
Is it possible to put the content of a cell dynamically into the VB code. Here is what I'm trying to do:

Workbook 1 contains a cell with the name "Workbook 2" in it. I want to have a button that can open Workbook 2 based on the content of that cell. That way if I change the content of that cell from "Workbook 2" to "Workbook 3" than when I hit the button Workbook 3 would open instead of Workbook 2.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Code:
Workbooks.Open Range("A1")

I quess when you're new, you focus so much on the hurdles you have trouble getting over, that you don't pay attention to the untied shoelace that ends up putting you on your face and makes you look the dumbest.

Thanks from the short bus.
 
Upvote 0

Forum statistics

Threads
1,224,550
Messages
6,179,462
Members
452,915
Latest member
hannnahheileen

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