Activate the top of sheet

A

AD108

I need to find a way to make the top of each sheet in a workbook visible
after my code runs. I tried "select" and "activate" but when you select
the sheet, the visible range is different.

Thanks in advance for help with this.
 
G

Gord Dibben

Couple of methods.

Add this to your macro

Sub test()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Sheets
ActiveWindow.ScrollRow = 1
'Range("A1").Select 'If you wish
Next ws
End Sub

Or in Thisworkbook module

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
ActiveWindow.ScrollRow = 1
End Sub


Gord Dibben MS Excel MVP
 
Top