Code so when worksheet is opened, it scrolls to top of page.

wudhus_kid

New Member
Joined
Aug 8, 2007
Messages
31
I would like a code so when a tab is clicked to open a worksheet, the worksheet is scrolled to the top of the page, as opposed to being wherever it was left by the previous user.

Any help would be much appreciated.

Many Thanks
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
wudhus_kid

Try this. Your description just says to the top of the page but doesn't mention scrolling to the left hand side as well. Therefore, you may not want the ScrollColumn line in this code.

If it doesn't do what you want, post back with further details.

<font face=Courier New><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> Worksheet_Activate()
    <SPAN style="color:#00007F">With</SPAN> ActiveWindow
        .ScrollRow = 1
        .ScrollColumn = 1
    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN>
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>
 
Upvote 0
In the module for the worksheet:

Code:
Private Sub Worksheet_Activate()
    Application.Goto Range("A1"), True
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,688
Members
448,978
Latest member
rrauni

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