Activate the top of sheet

  • Thread starter Thread starter AD108
  • Start date Start date
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top