Frank Freese
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
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=
ActiveWindow.ScrollRow=1
Set rng = Nothing
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER