Hyperlinks

M

mevetts

I seem to have lost the plot somwhere.

Should my next attempt involve naming a particulr range of cells an
then try setting up a hyperlink to that particular range?

Then use which piece of code, as there seems to be a few versions i
the thread now?

Many thanks,

Mark
 
M

mevetts

I used this code provided by Dave P. -

Option Explicit
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
On Error Resume Next
Application.Goto Application.Range(Target.SubAddress), Scroll:=True
On Error GoTo 0
End Sub

I named the range and when the link is now clicked the range displayed
begins at the top of the screen.

However, it highlights the entire range, is there any way of preventing
it doing this?

Also, does this issue (ie the linked to cell being displayed at the
bottom of the screen) happen in Excel 2003? As whilst I am at home at
the moment and using 2000, work has 2003. So if it's not an issue in
2003, I could perhaps just wait until I'm back at work to set-up the
links!

Thanks,

Mark.
 
D

Dave Peterson

Yes, it happens in xl2003, too.

Why not just use one cell as your hyperlink--instead of a multicell range?
 
M

mevetts

That was my original problem. When I click the link, it jumps to the
correct cell, but it is at the bottom of the screen, not the top. So I
then have to scroll down to view the rows.

I want it so when the link is clicked the cell to which it is linked is
displayed at the top of the screen.

Cheers,

Mark.
 
D

Dave Peterson

I selected a cell that would hold the hyperlink.

I hit ctrl-k (insert|hyperlink)
I chose "Place in this document".
I typed B923 in the "type the cell reference box"
(It was a single cell--the topleftcorner of the range--not a range of cells)
I finished up the hyperlink.

I added this to the worksheet module:

Option Explicit
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
On Error Resume Next
Application.Goto Application.Range(Target.SubAddress), Scroll:=True
On Error GoTo 0
End Sub

And just that single cell was selected and it was in the upper left corner of
the window.
 
M

mevetts

A BIG thumbs up from me Dave!!! It works.

Thanks soooooo much, especially for the perseverance.

Happy Christmas!

Mark.

P.S. I'm sure I will have another little challenge in the not too
distant future! ;)
 
D

Dave Peterson

Whew!!

Glad you got it working.
A BIG thumbs up from me Dave!!! It works.

Thanks soooooo much, especially for the perseverance.

Happy Christmas!

Mark.

P.S. I'm sure I will have another little challenge in the not too
distant future! ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top