Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

Hyperlink to a userform?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Al - 28 May 2008 19:06 GMT
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?
Signature

Al C

JNW - 28 May 2008 19:18 GMT
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

> 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?
Al - 28 May 2008 22:40 GMT
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.
Signature

Al C

> This should work.  just change cell reference to the cell that has your
> hyperlink
[quoted text clipped - 11 lines]
> > possible to create a hyperlink to the userform, or do I have to emulate it by
> > using a selection change event?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.