Move to top of worksheet

Noz2k

Well-known Member
Joined
Mar 15, 2011
Messages
693
I have a combobox which dependent upon the selection updates a worksheet.

However when the worksheet is updated the screen always shows the bottom of the sheet rather than the top.

How do I make it so that the screen shows the top of the form?
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Try this:

Code:
Sub ScrollAllSheetsTopLeft()
'Scrolls to topleft of all sheets
'Dimension variables
Dim sht As Worksheet
Dim shtActiveSht As Worksheet
'Determine the activesheet at start of code execution
Set shtActiveSht = ActiveSheet
'stop screen updates as code iterates sheets (Stops screen flashing)
With Application
    .ScreenUpdating = False
'iterate sheets moving the activewindow each time to row 1, column 1
    For Each sht In ActiveWorkbook.Worksheets
    sht.Activate
        With ActiveWindow
            .ScrollColumn = 1
            .ScrollRow = 1
        End With
'select top left cell on each sheet
    Range("A1").Select
    Next sht
'activate original starting sheet
shtActiveSht.Activate
'Turn screen updates back on
    .ScreenUpdating = True
End With
End Sub
Will only work if a range is selected at the end of your previous macro (not say a chart object)
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,181
Members
452,893
Latest member
denay

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