• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 199
  • Last Modified:

Move to a specific cell and make it the top

Folks,
In my spreadsheet I have command buttons that takes the user to specific cell location. For example, cmdTextFomatting_Click executes Range("A47").Select.  No problem here. However, the user has asked that when they go to a specific cell location that it also makes that cell location the top of the spreadsheet just as if the user scrolled.
Each section also has a command button labeled "Top" and this goes to cell A1 that returns them to the top. This is FYI so you can understand how they would return to the top.
I thought of hiding the columns not needed and unhiding them when they returned to the top, but wanted to know if there was an better way?
0
Frank Freese
Asked:
Frank Freese
  • 2
  • 2
2 Solutions
 
als315Commented:
Range("A47").Select
Application.Goto ActiveCell, True
0
 
Saqib Husain, SyedEngineerCommented:
Range("A47").Select
ActiveWindow.ScrollRow =Range("A47").row
0
 
Frank FreeseAuthor Commented:
thanks...both solutions go me what I was looking for. Can't complain about two for one.
I really appreciate all RR responses - very much
0
 
Saqib Husain, SyedEngineerCommented:
The advantage of scrollrow is that you can also show a number of rows above the selected cell as in

ActiveWindow.ScrollRow =Range("A47").row -2
0
 
Frank FreeseAuthor Commented:
thanks for the tip and follow-up
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now