Activate Window based on A1

bobaol

Board Regular
Joined
Jun 3, 2002
Messages
190
Office Version
  1. 365
  2. 2003 or older
Platform
  1. Windows
Hello, I have a macro to go to many Windows. Here is the hard-coded version of one window I am activating. I want to activate the window based on cell A1. Cell A1 will have the value of the window name in it.

Sub Macro44()
Windows("Raw_Tables_18.xlsm").Activate
Application.Goto Reference:="R1C1"
End Sub

I tried this, but it does not work.

Sub Macro45()
Windows(range("a1")).Activate
Application.Goto Reference:="R1C1"
End Sub

Any help is appreciated. Thanks in advance.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
The following works for me:
VBA Code:
Sub MacroA1()
    Dim s As String
    s = Range("A1")
    Windows(s).Activate
    Range("A1").Select
End Sub
 
Upvote 0
Solution
Ho Ho Ho! thank you for the present! it works. Very grateful.
 
Upvote 0

Forum statistics

Threads
1,215,072
Messages
6,122,966
Members
449,094
Latest member
Anshu121

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