View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
p45cal[_175_] p45cal[_175_] is offline
external usenet poster
 
Posts: 1
Default IS it possible to add Hyperlink to a commandbutton on a Userform


Ayo;539341 Wrote:
I have a userform with a commandbutton. I want to add an hyperlink to
the
commandbutton so that when the commandbutton is click, it opens up the
website. How do I go about doing that?
Thanks


double-click the button in the vbe and enter the following code where
the cursor flashes:

On Error GoTo NoCanDo
ActiveWorkbook.FollowHyperlink Address:="http://www.google.com",
NewWindow:=True
Exit Sub
NoCanDo:
MsgBox "Cannot open the link"
End Sub


--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=148256