Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Assign a Hyperlink to a button

Oh Wise Ones,
I have been searching old posts and cannot find
something that works for me. I would like to assign a hyperlink to another
sheet to a button. It was suggested to use the Follow Hyperlink event, but
it does not show up as an assignable macro. The command button click event
would not allow me to get to click mode on the button- always had crosshairs.
Obviously I'm doing something wrong, and some help would be much
appreciated.

1) Place a button on the worksheet.
2) click on it
3) takes me to:
HYPERLINK("file:S:\common\Lab\DataSheets\Asphalt\F iller\Filler%
Datasheet.xls" (not sure if the syntax is right, its what I use in a
cell)

Thanks,
Mike

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Assign a Hyperlink to a button

If you used a commandbutton from the control toolbox toolbar, you don't assign a
macro to it. It has its own _click event.

If you go back to that button and double click on it (make sure you're in design
mode--another icon on that control toolbox toolbar), you'll see a code windo
open.

You can use a macro like:

Option Explicit
Private Sub CommandButton1_Click()
ThisWorkbook.FollowHyperlink _
Address:="File:\\\\S:\common\Lab\DataSheets\Asphal t\Filler\Filler%" _
& "Datasheet.xls"
End Sub

You could also use a shape from the drawing toolbar (or a insert a picture) and
directly assign the hyperlink to that shape/picture.



Mike K wrote:

Oh Wise Ones,
I have been searching old posts and cannot find
something that works for me. I would like to assign a hyperlink to another
sheet to a button. It was suggested to use the Follow Hyperlink event, but
it does not show up as an assignable macro. The command button click event
would not allow me to get to click mode on the button- always had crosshairs.
Obviously I'm doing something wrong, and some help would be much
appreciated.

1) Place a button on the worksheet.
2) click on it
3) takes me to:
HYPERLINK("file:S:\common\Lab\DataSheets\Asphalt\F iller\Filler%
Datasheet.xls" (not sure if the syntax is right, its what I use in a
cell)

Thanks,
Mike


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Assign a Hyperlink to a button

Dave,
Getting and error "Compile error, variable not defined" when
running.

Mike

"Dave Peterson" wrote:

If you used a commandbutton from the control toolbox toolbar, you don't assign a
macro to it. It has its own _click event.

If you go back to that button and double click on it (make sure you're in design
mode--another icon on that control toolbox toolbar), you'll see a code windo
open.

You can use a macro like:

Option Explicit
Private Sub CommandButton1_Click()
ThisWorkbook.FollowHyperlink _
Address:="File:\\\\S:\common\Lab\DataSheets\Asphal t\Filler\Filler%" _
& "Datasheet.xls"
End Sub

You could also use a shape from the drawing toolbar (or a insert a picture) and
directly assign the hyperlink to that shape/picture.



Mike K wrote:

Oh Wise Ones,
I have been searching old posts and cannot find
something that works for me. I would like to assign a hyperlink to another
sheet to a button. It was suggested to use the Follow Hyperlink event, but
it does not show up as an assignable macro. The command button click event
would not allow me to get to click mode on the button- always had crosshairs.
Obviously I'm doing something wrong, and some help would be much
appreciated.

1) Place a button on the worksheet.
2) click on it
3) takes me to:
HYPERLINK("file:S:\common\Lab\DataSheets\Asphalt\F iller\Filler%
Datasheet.xls" (not sure if the syntax is right, its what I use in a
cell)

Thanks,
Mike


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Assign a Hyperlink to a button

You changed something and didn't share what you did.

I don't have a guess how you changed it.


Mike K wrote:

Dave,
Getting and error "Compile error, variable not defined" when
running.

Mike

"Dave Peterson" wrote:

If you used a commandbutton from the control toolbox toolbar, you don't assign a
macro to it. It has its own _click event.

If you go back to that button and double click on it (make sure you're in design
mode--another icon on that control toolbox toolbar), you'll see a code windo
open.

You can use a macro like:

Option Explicit
Private Sub CommandButton1_Click()
ThisWorkbook.FollowHyperlink _
Address:="File:\\\\S:\common\Lab\DataSheets\Asphal t\Filler\Filler%" _
& "Datasheet.xls"
End Sub

You could also use a shape from the drawing toolbar (or a insert a picture) and
directly assign the hyperlink to that shape/picture.



Mike K wrote:

Oh Wise Ones,
I have been searching old posts and cannot find
something that works for me. I would like to assign a hyperlink to another
sheet to a button. It was suggested to use the Follow Hyperlink event, but
it does not show up as an assignable macro. The command button click event
would not allow me to get to click mode on the button- always had crosshairs.
Obviously I'm doing something wrong, and some help would be much
appreciated.

1) Place a button on the worksheet.
2) click on it
3) takes me to:
HYPERLINK("file:S:\common\Lab\DataSheets\Asphalt\F iller\Filler%
Datasheet.xls" (not sure if the syntax is right, its what I use in a
cell)

Thanks,
Mike


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Assign a Hyperlink to a button

You changed something and didn't share what you did.

I don't have a guess how you changed it.


Mike K wrote:

Dave,
Getting and error "Compile error, variable not defined" when
running.

Mike

"Dave Peterson" wrote:

If you used a commandbutton from the control toolbox toolbar, you don't assign a
macro to it. It has its own _click event.

If you go back to that button and double click on it (make sure you're in design
mode--another icon on that control toolbox toolbar), you'll see a code windo
open.

You can use a macro like:

Option Explicit
Private Sub CommandButton1_Click()
ThisWorkbook.FollowHyperlink _
Address:="File:\\\\S:\common\Lab\DataSheets\Asphal t\Filler\Filler%" _
& "Datasheet.xls"
End Sub

You could also use a shape from the drawing toolbar (or a insert a picture) and
directly assign the hyperlink to that shape/picture.



Mike K wrote:

Oh Wise Ones,
I have been searching old posts and cannot find
something that works for me. I would like to assign a hyperlink to another
sheet to a button. It was suggested to use the Follow Hyperlink event, but
it does not show up as an assignable macro. The command button click event
would not allow me to get to click mode on the button- always had crosshairs.
Obviously I'm doing something wrong, and some help would be much
appreciated.

1) Place a button on the worksheet.
2) click on it
3) takes me to:
HYPERLINK("file:S:\common\Lab\DataSheets\Asphalt\F iller\Filler%
Datasheet.xls" (not sure if the syntax is right, its what I use in a
cell)

Thanks,
Mike


--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Assign a Hyperlink to a button

Dave,
Thanks for your time and effort. I already use that file in a
regular hyperlink in a cell. Nothing has been changed. I copy/pasted your
whole macro. At this point I can use workbook_open on a button(I recorded it
and it worked) , I was just trying to use the hyperlink in a macro to see
how it worked.

In summery:
this function IN A CELL works:
=HYPERLINK("file:S:\common\Lab\DataSheets\Asphalt\ Filler\Filler%
Datasheet.xls","Filler %")

The fonts on my cell hyperlinks tend to get "adjusted" from time to time. I
thought buttons would work better when other people use them.


Thanks,
Mike


"Dave Peterson" wrote:

You changed something and didn't share what you did.

I don't have a guess how you changed it.


Mike K wrote:

Dave,
Getting and error "Compile error, variable not defined" when
running.

Mike

"Dave Peterson" wrote:

If you used a commandbutton from the control toolbox toolbar, you don't assign a
macro to it. It has its own _click event.

If you go back to that button and double click on it (make sure you're in design
mode--another icon on that control toolbox toolbar), you'll see a code windo
open.

You can use a macro like:

Option Explicit
Private Sub CommandButton1_Click()
ThisWorkbook.FollowHyperlink _
Address:="File:\\\\S:\common\Lab\DataSheets\Asphal t\Filler\Filler%" _
& "Datasheet.xls"
End Sub

You could also use a shape from the drawing toolbar (or a insert a picture) and
directly assign the hyperlink to that shape/picture.



Mike K wrote:

Oh Wise Ones,
I have been searching old posts and cannot find
something that works for me. I would like to assign a hyperlink to another
sheet to a button. It was suggested to use the Follow Hyperlink event, but
it does not show up as an assignable macro. The command button click event
would not allow me to get to click mode on the button- always had crosshairs.
Obviously I'm doing something wrong, and some help would be much
appreciated.

1) Place a button on the worksheet.
2) click on it
3) takes me to:
HYPERLINK("file:S:\common\Lab\DataSheets\Asphalt\F iller\Filler%
Datasheet.xls" (not sure if the syntax is right, its what I use in a
cell)

Thanks,
Mike

--

Dave Peterson


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Assign a Hyperlink to a button

Make sure I didn't make a typo.

Make sure that the file exists in that location.

I tried it again and got a "cannot open file" prompt. I don't have that file
available.

Mike K wrote:

Dave,
Thanks for your time and effort. I already use that file in a
regular hyperlink in a cell. Nothing has been changed. I copy/pasted your
whole macro. At this point I can use workbook_open on a button(I recorded it
and it worked) , I was just trying to use the hyperlink in a macro to see
how it worked.

In summery:
this function IN A CELL works:
=HYPERLINK("file:S:\common\Lab\DataSheets\Asphalt\ Filler\Filler%
Datasheet.xls","Filler %")

The fonts on my cell hyperlinks tend to get "adjusted" from time to time. I
thought buttons would work better when other people use them.

Thanks,
Mike

"Dave Peterson" wrote:

You changed something and didn't share what you did.

I don't have a guess how you changed it.


Mike K wrote:

Dave,
Getting and error "Compile error, variable not defined" when
running.

Mike

"Dave Peterson" wrote:

If you used a commandbutton from the control toolbox toolbar, you don't assign a
macro to it. It has its own _click event.

If you go back to that button and double click on it (make sure you're in design
mode--another icon on that control toolbox toolbar), you'll see a code windo
open.

You can use a macro like:

Option Explicit
Private Sub CommandButton1_Click()
ThisWorkbook.FollowHyperlink _
Address:="File:\\\\S:\common\Lab\DataSheets\Asphal t\Filler\Filler%" _
& "Datasheet.xls"
End Sub

You could also use a shape from the drawing toolbar (or a insert a picture) and
directly assign the hyperlink to that shape/picture.



Mike K wrote:

Oh Wise Ones,
I have been searching old posts and cannot find
something that works for me. I would like to assign a hyperlink to another
sheet to a button. It was suggested to use the Follow Hyperlink event, but
it does not show up as an assignable macro. The command button click event
would not allow me to get to click mode on the button- always had crosshairs.
Obviously I'm doing something wrong, and some help would be much
appreciated.

1) Place a button on the worksheet.
2) click on it
3) takes me to:
HYPERLINK("file:S:\common\Lab\DataSheets\Asphalt\F iller\Filler%
Datasheet.xls" (not sure if the syntax is right, its what I use in a
cell)

Thanks,
Mike

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Assign a Hyperlink to a button

Put ANY piece of ClipArt on the worksheet. (if you like buttons, use a
rectangle from AutoShapes)

Right-click the Object and pick Hyperlink from the resulting menu.
--
Gary''s Student - gsnu200830


"Mike K" wrote:

Oh Wise Ones,
I have been searching old posts and cannot find
something that works for me. I would like to assign a hyperlink to another
sheet to a button. It was suggested to use the Follow Hyperlink event, but
it does not show up as an assignable macro. The command button click event
would not allow me to get to click mode on the button- always had crosshairs.
Obviously I'm doing something wrong, and some help would be much
appreciated.

1) Place a button on the worksheet.
2) click on it
3) takes me to:
HYPERLINK("file:S:\common\Lab\DataSheets\Asphalt\F iller\Filler%
Datasheet.xls" (not sure if the syntax is right, its what I use in a
cell)

Thanks,
Mike

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Assign a Hyperlink to a button

No problems when assigning the hyperlink, but when I click it I get an error
"Cannot open specified file"

"Gary''s Student" wrote:

Put ANY piece of ClipArt on the worksheet. (if you like buttons, use a
rectangle from AutoShapes)

Right-click the Object and pick Hyperlink from the resulting menu.
--
Gary''s Student - gsnu200830


"Mike K" wrote:

Oh Wise Ones,
I have been searching old posts and cannot find
something that works for me. I would like to assign a hyperlink to another
sheet to a button. It was suggested to use the Follow Hyperlink event, but
it does not show up as an assignable macro. The command button click event
would not allow me to get to click mode on the button- always had crosshairs.
Obviously I'm doing something wrong, and some help would be much
appreciated.

1) Place a button on the worksheet.
2) click on it
3) takes me to:
HYPERLINK("file:S:\common\Lab\DataSheets\Asphalt\F iller\Filler%
Datasheet.xls" (not sure if the syntax is right, its what I use in a
cell)

Thanks,
Mike

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Assign a Hyperlink to a button

I'd guess you don't have a file with that filename in that path.

Mike K wrote:

No problems when assigning the hyperlink, but when I click it I get an error
"Cannot open specified file"

"Gary''s Student" wrote:

Put ANY piece of ClipArt on the worksheet. (if you like buttons, use a
rectangle from AutoShapes)

Right-click the Object and pick Hyperlink from the resulting menu.
--
Gary''s Student - gsnu200830


"Mike K" wrote:

Oh Wise Ones,
I have been searching old posts and cannot find
something that works for me. I would like to assign a hyperlink to another
sheet to a button. It was suggested to use the Follow Hyperlink event, but
it does not show up as an assignable macro. The command button click event
would not allow me to get to click mode on the button- always had crosshairs.
Obviously I'm doing something wrong, and some help would be much
appreciated.

1) Place a button on the worksheet.
2) click on it
3) takes me to:
HYPERLINK("file:S:\common\Lab\DataSheets\Asphalt\F iller\Filler%
Datasheet.xls" (not sure if the syntax is right, its what I use in a
cell)

Thanks,
Mike


--

Dave Peterson


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
How to assign a hyperlink to a button on a form? Bremser Excel Programming 2 March 26th 08 11:22 PM
Assign a macro to a hyperlink Daminc[_67_] Excel Programming 5 May 2nd 06 01:51 PM
Assign a macro to a hyperlink Daminc[_66_] Excel Programming 0 April 28th 06 03:04 PM
How can I assign a symbol to a button (like the $ button) NickW Excel Discussion (Misc queries) 2 September 6th 05 02:45 PM
how to Assign Hyperlink to Button in Spreadsheet Warren Deeker Excel Discussion (Misc queries) 1 June 9th 05 02:05 PM


All times are GMT +1. The time now is 07:24 PM.

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

About Us

"It's about Microsoft Excel"