View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default scrolling target cell to top of page after hyperlink

Let's make sure the routine is in the correct area. It needs to go in the
worksheet code area:


It is very easy to install and automatic to use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you have any concerns, first try it on a trial worksheet.

If you save the workbook, the macro will be saved with it.


To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm




--
Gary''s Student - gsnu200746


"BROCK8292" wrote:

thanks for the response garys student
i tried pasting it in the code of either spreadsheet but neither worked
do you have any other ideas
thank you
brock

"Gary''s Student" wrote:

paste this small macro in the worksheet code area:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Application.Goto Reference:=ActiveCell.Address(ReferenceStyle:=xlR1 C1),
Scroll:=True
End Sub

be careful of the wrap
--
Gary''s Student - gsnu200746


"BROCK8292" wrote:

i am now trying to get the target cells of my hyperlinks to appear at the top
of the page instead of at the bottom. i know you answered this one in bill
elerdings post "execute macro after hyperlink" but i cant get it to work,
maybe because i wrote my hyperlink formulas instead of inserting them into
the cells.
is there anything else you can think of
thank you for your continued assistance
brock