Link to home
Start Free TrialLog in
Avatar of Frank Freese
Frank FreeseFlag for United States of America

asked on

Code to scroll and return to a home position

Experts,
I'm not very good at writing macros yet and was given some help. The code belows does not work. Here's my objective:

Row 5 in my spreadsheet is frozen.
In my spreadhseet R(5) C(0) I have a command button. The purpose for this to take me back to R(5) C(0) when is at other locations in my spreadsheet. I can get to my location but I havefigured out how to automatically rescroll where the spreadsheet has been restored just as if I had opened it. Here's my attempt:

Sub Home()
Dim rng As Range
Set rng = Month Total("A5:A80").RefersTo
    rng.Parent.Select
    rng.Select
ActiveWindow.ScrollColumn=1
ActiveWindow.ScrollRow=1
Set rng = Nothing
End Sub
ASKER CERTIFIED SOLUTION
Avatar of Rory Archibald
Rory Archibald
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Frank Freese

ASKER

that is exactly what I needed - thank you