VBA: Activate Window with Cell Reference

adberg

New Member
Joined
Jun 15, 2012
Messages
4
Hi again,

So I have to activate a workbook, but the workbook name must be dynamic in the VBA. I am trying to make it reference a specific cell but I keep getting an error. Currently I have this setup:

Windows("2H12 Training Workbook.xlsm").Activate

But, I want the 2H12 to reference a cell. I have tried this with no luck:

Windows("(Sheets("Input").Range("A1").Value) & " Training Workbook.xlsm").Activate

Any suggestions?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
In order to activate it, you must have the file first opened.
Maybe that's the problem?

What is the error message you're getting?
 
Upvote 0
In order to activate it, you must have the file first opened.
Maybe that's the problem?

What is the error message you're getting?

Yes the window is already opened. It switches back and forth between mutilple windows multiple times.
 
Upvote 0

Forum statistics

Threads
1,206,814
Messages
6,075,031
Members
446,114
Latest member
FadDak

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