Passing value from Hyperlink

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I need to copy the value of a hyperlinked cell to the destination cell called forth by the hyperlink. Any idea how to go about it?
 
it takes two steps
1) insert a formula to reference the value of the cell,
2) and then a hyperlink to that same cell. the linked value will show
but it willlink to the other book when clicked upon. I never though
of this before you brought it up. I can see some useful tricks i
this... here is a little snippet of the macro i recorded to test this


'begin code
Sub Macro1()

'
ActiveCell.FormulaR1C1 = "='[Activity Codes.xls]Cover'!R1C1"
Range("A1").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"\\Windows\Current Projects\Activity Codes.xls", _
SubAddress:="Cover!A1"

End Sub
'end cod
 
Hi
you may put the following macro in your worksheet module (the worksheet
of your hyperlink):

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Dim source_value
Dim varsplit
source_value = Target.Parent.Value
varsplit = Split(Target.SubAddress, "!")
Worksheets(varsplit(0)).Range(varsplit(1)).Value = source_value
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany

Albertob said:
Hello,

I need to copy the value of a hyperlinked cell to the destination
cell called forth by the hyperlink. Any idea how to go about it?
 
ah, i see... it's going the other way round! well then, ignore m
response please
 
Perfect, I've tried and it does exactly what I wanted it. Thanks a bunch.
 
Actually, it works for the first two cells in a list of ten items, the next eight items (hyperlinked) jump onto the desired destination but will paste an incorrect value. How do I fix this.
 
Hi
not quite sure: does my code work for you or not??

--
Regards
Frank Kabel
Frankfurt, Germany

Albertob said:
Actually, it works for the first two cells in a list of ten items,
the next eight items (hyperlinked) jump onto the desired destination
but will paste an incorrect value. How do I fix this.
 
I have a list of the items, cells b27:b36, each with a hyperlink to the same sheet and cell; the funny thing is that the first two cell's hyperlink jump onto the desired destination passing on its value; the remaining cells do not :-(
 
Hi
just tested it with approx. 20 values all linked to the same cell and
no problem with the procedure. If you like email me your sheet and I'll
have a look at it
email: frank[dot]kabel[at]freenet[dot]de


--
Regards
Frank Kabel
Frankfurt, Germany

Albertob said:
I have a list of the items, cells b27:b36, each with a hyperlink to
the same sheet and cell; the funny thing is that the first two cell's
hyperlink jump onto the desired destination passing on its value; the
remaining cells do not :-(
 
I copied the hyperlinks and somehow it didn't worked; but after creating the links individualy it worked perfect. Thanks
 
Hi

I have just used your code for my project and it works perfectly unti
I forward my worksheet to someone using excel 97. The hyperlink stil
works but the value is not updated. Does anyone know of a fix fo
this
 
Perhaps in the Excel forum this question makes sense, but in the Newgroup
where most of the answers come from, this sounds like nonsensical jibberish
since it is at the top of a thread and there is no context to define "your"
or what code you are using.
 

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

Back
Top