Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Code to scroll and return to a home position

Posted on 2011-02-11
2
Medium Priority
?
258 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

688 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