Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Option Explicit
Private Sub CommandButton1_Click() ThisWorkbook.FollowHyperlink Address:="http://www.microsoft.com" End Sub I think I'd use a label--format with blue font and underline--like a hyperlink you'd see in the worksheet. Ayo 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 -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On button click
ActiveWorkbook.FollowHyperlink "http://www.microsoft.com" If this post helps click Yes --------------- Jacob Skaria "Ayo" 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks.
"Jacob Skaria" wrote: On button click ActiveWorkbook.FollowHyperlink "http://www.microsoft.com" If this post helps click Yes --------------- Jacob Skaria "Ayo" 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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
But how would I change the mouse to the pointing finger to stimulate clicking
the label? "Dave Peterson" wrote: Option Explicit Private Sub CommandButton1_Click() ThisWorkbook.FollowHyperlink Address:="http://www.microsoft.com" End Sub I think I'd use a label--format with blue font and underline--like a hyperlink you'd see in the worksheet. Ayo 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 -- Dave Peterson . |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Select the Label control, then (in the Properties Window) set the
MousePointer property to 99-fmMousePointerCustom and then set the MouseIcon property to a compatible ICO or CUR file (stay away from any marked "aero") in your Windows/Cursors directory (there is a pointing hand cursor in there that will work). -- Rick (MVP - Excel) "Ayo" wrote in message ... But how would I change the mouse to the pointing finger to stimulate clicking the label? "Dave Peterson" wrote: Option Explicit Private Sub CommandButton1_Click() ThisWorkbook.FollowHyperlink Address:="http://www.microsoft.com" End Sub I think I'd use a label--format with blue font and underline--like a hyperlink you'd see in the worksheet. Ayo 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 -- Dave Peterson . |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks so much Rick. Works great.
"Rick Rothstein" wrote: Select the Label control, then (in the Properties Window) set the MousePointer property to 99-fmMousePointerCustom and then set the MouseIcon property to a compatible ICO or CUR file (stay away from any marked "aero") in your Windows/Cursors directory (there is a pointing hand cursor in there that will work). -- Rick (MVP - Excel) "Ayo" wrote in message ... But how would I change the mouse to the pointing finger to stimulate clicking the label? "Dave Peterson" wrote: Option Explicit Private Sub CommandButton1_Click() ThisWorkbook.FollowHyperlink Address:="http://www.microsoft.com" End Sub I think I'd use a label--format with blue font and underline--like a hyperlink you'd see in the worksheet. Ayo 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 -- Dave Peterson . . |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to perform something similar in one of my projects. How do I
modify the "hyperlink" syntax to open an Excel file on the server instead? ThisWorkbook.FollowHyperlink Address:="\\server\share\folder1\folder2\filename. xls" *** Sent via Developersdex http://www.developersdex.com *** |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
NM, I am all set. I was using variables to build the file path and just
needed to make them public. *** Sent via Developersdex http://www.developersdex.com *** |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
NM, I am all set. I was using variables to build the file path and just
needed to make them public. *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hyperlink using commandbutton? | Excel Discussion (Misc queries) | |||
Hyperlink in Commandbutton | Excel Programming | |||
UserForm CommandButton Caption | Excel Programming | |||
CommandButton - Userform | Excel Discussion (Misc queries) | |||
Assigning a Hyperlink to a CommandButton | Excel Discussion (Misc queries) |