Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default IS it possible to add Hyperlink to a commandbutton on a Userform

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default IS it possible to add Hyperlink to a commandbutton on a Userform

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default IS it possible to add Hyperlink to a commandbutton on a Userform

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   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default IS it possible to add Hyperlink to a commandbutton on a Userfo

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   Report Post  
Posted to microsoft.public.excel.programming
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



  #6   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default IS it possible to add Hyperlink to a commandbutton on a Userfo

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default IS it possible to add Hyperlink to a commandbutton on a Userfo

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   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default IS it possible to add Hyperlink to a commandbutton on a Userfo

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default IS it possible to add Hyperlink to a commandbutton on a Userfo

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default IS it possible to add Hyperlink to a commandbutton on a Userfo

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default IS it possible to add Hyperlink to a commandbutton on a Userfo

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlink using commandbutton? Bob Excel Discussion (Misc queries) 2 May 29th 09 12:54 PM
Hyperlink in Commandbutton bgkgmg Excel Programming 4 March 2nd 09 01:56 AM
UserForm CommandButton Caption PCLIVE Excel Programming 3 January 29th 07 11:01 PM
CommandButton - Userform Marcia3641 Excel Discussion (Misc queries) 2 July 21st 05 06:39 PM
Assigning a Hyperlink to a CommandButton Andy T Excel Discussion (Misc queries) 2 December 21st 04 12:31 PM


All times are GMT +1. The time now is 11:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"