Hyperlink to a userform?

A

Al

I have a macro that assembles a series of user workbooks from a template
library, and some cells have hyperlinks that are constructed based on user
data entries. I now have a need to give the user a choice of hyperlink from
certain cells, and my plan is to provide a userform to handle that. Is it
possible to create a hyperlink to the userform, or do I have to emulate it by
using a selection change event?
 
J

JNW

This should work. just change cell reference to the cell that has your
hyperlink

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
If Not Intersect(Target.Parent, Range("c9")) Is Nothing Then
MySub 'sub to open userform or just userform.show
End If
End Sub
 
A

Al

Yes. That would work if I could enter the code by hand, but I need to have
the macro create the links dynamically after the user enters data, and I
can't know in advance even which cells need the multiple links. I can have
the macro set up a range and populate it with the appropriate hyperlink
names, link the controls to those names, adjust the userform so only the live
controls are accessable, and access the userform through the event handler,
but I'm looking to see if there is an easier way to get there.
 

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