Solved

Code to scroll and return to a home position

Posted on 2011-02-11
2
250 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
Comment Utility
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
Comment Utility
that is exactly what I needed - thank you
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

771 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

11 Experts available now in Live!

Get 1:1 Help Now