Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlink in msgbox 1

Status
Not open for further replies.

leassaf

Instructor
May 20, 2001
49
IL
Does anyone know a way of making a part of a text in a msgbox be a hyperlink (to a file or a URL)?

 
AFAIK, this can't be done as a message box has to return a yes or no constant to excel - you might want to look at creating a userform that looks like a message box - then I think you can put hyperlinks on forms (failing that you can use a button)
HTH
Geoff
 
Ratman Special of the Day:

Sub hyperlinkInMsgBox()
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="msg = "Do you want to go to now?"
Ans = MsgBox(msg, vbQuestion + vbYesNoCancel)
Select Case Ans
Case vbYes
ActiveSheet.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Application.WindowState = xlNormal
GoTo alldone
Case vbNo
Cancel = True
GoTo alldone
Case vbCancel
Cancel = True
GoTo alldone
End Select
alldone:
End Sub
 
Very nice Ratman - have a star - that's a good workaround - would suggest a:
Selection.clearcontents after alldone: though - just to tidy up

Rgds
Geoff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top