bring hyperlinked cell to top of page

T

Tina

Is there a way to bring the hyperlinked cell to the top of the page?
Currently, when I select my hyperlinked text, it takes me to the correct
cell, but the cell is always at the bottom of the page. I need it to be at
the top of the page so the user sees it promptly.

Thank you!!
 
P

Patricia Shannon

You might be able to use the following with the FollowHyperlink event. I'm
fairly new to Excel and visual basic programming, so you might know more
about how to do this than I do.

Sub ActiveTop()

' Move active cell to top of window

' Shortcut key: Ctrl+Shift+A

ActiveWindow.ScrollRow = ActiveCell.Row

End Sub

Good luck,
Patricia Shannon
 
T

Tina

Actually, I'm a newbie to VB too. Where would I find the FollowHyperlink
event and how/where would I enter this code?
 
P

Patricia Shannon

I need to know how much detail to go into.
Do you know how to create a macro?
Do you know how to use the visual basic editor?
 
P

Patricia Shannon

I need more detail. Is the hyperlink in an Excel spreadsheet, pointing to a
different Excel spreadsheet, or what?
 
T

Tina

Thanks for your reply but I figured it out. Instead of a hyperlink, I used a
command button with 4 lines of code:

Private Sub CommandButton1_Click()
Range("a50").Select
ActiveWindow.ScrollRow = ActiveCell.Row
End Sub

I hope this can help someone else.
 
P

Patricia Shannon

I'm glad you figured it out. If I had known the situation, I had already
written a macro that might have helped. In fact I just wrote it within the
last week. It puts the row containing the active cell at the top of the
screen. I have it on a toolbar button and assigned to Ctrl+t.

Sub ActiveTop()

' Move active cell to top of window
' Shortcut key: Ctrl+t

ActiveWindow.ScrollRow = ActiveCell.Row

End Sub
 
P

Patricia Shannon

p.s., I realize that you have this code as part of your macro, but I thought
it might be of some help to people just beginning to use Excel VBA.
 
Top