Solved

Code to scroll and return to a home position

Posted on 2011-02-11
2
251 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:Frank Freese
2 Comments
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 34872123
I think you mean something like:

Sub Home()
   With ActiveWindow.Panes(2)
      .ScrollColumn = 1
      .ScrollRow = 6
   End With
   Range("A5").Select
End Sub

Open in new window

0
 

Author Closing Comment

by:Frank Freese
ID: 34872152
that is exactly what I needed - thank you
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now