Require workbook open vba

kelly1

Well-known Member
Joined
May 11, 2003
Messages
525
I have 2 linked workbooks

I open workbook ‘Team Sheet.xls’ first
Then open ‘forms.xls’ second

What I need is
When the ‘Forms.xls’ opens, it goes straight to ‘Team Sheet.xls’ worksheet ‘Totals’ A1

Could someone help please?


Kelly
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
You can use something like this:

<font face=Tahoma><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> Workbook_Open()
    Windows("Team Sheet").Activate
    Application.Goto [<SPAN style="color:#007F00">'Totals'!A1]</SPAN>
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

Note that you might want to record opening the Forms workbook (you'll get the correct path with the recorder) and putting that in the Team Sheet Workbook_Open event.

Hope that helps,

Smitty
 
Upvote 0
The recorder produce this:

Sub Macro2()
'
'
Windows("Team Sheet.xls").Activate
Range("A1").Select
End Sub


I can't get it to work with a worksheet open
I get error 9
Script out of range


Kelly
 
Upvote 0
Hmmm....You'll get that error if Team Sheet isn't open, but it should work just fine as recorded.

Smitty
 
Upvote 0
I've put this in the worksheet and am getting the error on line
Windows("Team Sheet.xls").Activate

This is with the other sheet open





Private Sub Workbook_Open()

'
'
Windows("Team Sheet.xls").Activate
Application.Goto ['Totals'!A1]
End Sub
 
Upvote 0

Forum statistics

Threads
1,203,465
Messages
6,055,576
Members
444,799
Latest member
CraigCrowhurst

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