View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Judge Platt Judge Platt is offline
external usenet poster
 
Posts: 5
Default Create a form button for email

Thanks, Leonardo. I followed those instructions, changing only the cell
reference. However, when I click the button, I get the error message
"subscript out of range", and in VB the second line (starting with
Selection.Hyperlinks(1)) is highlighted. Any ideas?

" wrote:

Hi Judge,
Try the following:
-Add the VB toolbar to your menus: View/Toolbars/Control toolbox
-On that menu select the button looking control (sixth icon on my bar)
and draw a button on your spreadsheet by dragging your mouse
-you should now see a button on your spreadsheet that reads
"CommandButton1".
-doubleclick on your button, you should get a code window with the
following lines:
Private Sub CommandButton1_Click()

End Sub
-Add the following two instructions to your code, just replace A40
with the cell where your hyperlink is; your function should look like
this at the end:
Private Sub CommandButton1_Click()
Range("A40").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
End Sub
-Close that window.
-On the bar you added look for the "Exit Design Mode" button (first
one on my bar). As soon as you click it, you should turn to "play"
mode.
-If you click on the button, it should action the hyperlink
-Just color white the hyperlink text on the cell so the users cannot
see it.

Hope this helps ;)