Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to assign a hyperlink to a button on a form? | Excel Programming | |||
Assign a macro to a hyperlink | Excel Programming | |||
Assign a macro to a hyperlink | Excel Programming | |||
How can I assign a symbol to a button (like the $ button) | Excel Discussion (Misc queries) | |||
how to Assign Hyperlink to Button in Spreadsheet | Excel Discussion (Misc queries) |