-
You could use
[vba]Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim c As Range
Select Case Sh.Name
Case "Name1"
Set c = Sh.Cells(Rows.Count, 5).End(xlUp)(2)
ActiveWindow.ScrollRow = c.Row - 5
c.Select
Case "Name2", "Name3", "Name4", "Name5"
Set c = Sh.Cells(Rows.Count, 2).End(xlUp)(2)
ActiveWindow.ScrollRow = c.Row - 5
c.Select
Case Else
'Do Nothing
End Select
End Sub
[/vba]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules