View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default hyperlink - place in this document - can discover caller in target sheet?

Perhaps this event...



Worksheet_FollowHyperlink



..but there may be a better way to handle whatever it is your trying
to

do. EURO Can you elaborate?


Tried that, but no go.
I have a dynamic report that is updated based on an employee
selection. If you are on the report sheet, this selection is made
via a combobox. It is also possible to select an employee from a
roster located on another sheet. Right now I use a hyperlink. I
need to identify the caller so I can regenerate the report. It
doesn't look like the hyper link will make it.


If you impliment using a local scope defined name on the report sheet,
you can update that when the respective name on the roster list is
clicked. Then your report generator can read the name and carry on...

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Sheets("Report").Names("CallerID").RefersTo = _
"=""" & Target.Parent & """"
End Sub

...where the defined name is initialized with an empty string when
created, and your report generator restores its value to an empty
string after doing its thing.

You can also have your combobox use this same mechanism so your report
generator code needs only to retrieve the name stored in 'CallerID'.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion