On Sheet Activate code

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,453
I have defined a sheet with a Scroll Area = "A1:K27" setting it thusly in the Sheet_Activate Event. At present
it opens way off to the left hand side of the window. I'm interested in CENTERING - IT, but can't seem to get the
code I need. I tried Chip Pearson's "Center on Cell" macro but it didn't work. Has anyone else got any ideas?

TIA,

Jim
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,033
Does this work:

Code:
Private Sub Worksheet_Activate()
'Modified  2/6/2019  7:31:54 PM  EST
ScrollArea = "A1:K27"
  Dim i As Long
  Dim j As Long
        With ActiveWindow
            i = .VisibleRange.Rows.Count / 2
            j = .VisibleRange.Columns.Count / 2
            .SmallScroll Up:=i, ToLeft:=j
        End With
End Sub
 

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
16,644
I don't understand what you mean by "CENTERING - IT". There are no columns to the left of col A and no rows above row 1.
 

Forum statistics

Threads
1,077,649
Messages
5,335,482
Members
399,018
Latest member
KathyMoUHC

Some videos you may like

This Week's Hot Topics

Top