On Sheet Activate code

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,486
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
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
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
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,223,268
Messages
6,171,100
Members
452,379
Latest member
IainTru

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