Solved

Code to scroll and return to a home position

Posted on 2011-02-11
2
256 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

752 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