ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   setting a command button to be a hyperlink (https://www.excelbanter.com/excel-programming/304174-setting-command-button-hyperlink.html)

neowok[_70_]

setting a command button to be a hyperlink
 
I want to have a command button act basically as a hyperlink, click th
button and it goes to a url specified in code. what i dont know i
what code will do it.

I have come up with

Private Sub CommandButton6_Click()
Dim h As Hyperlink
Set h = ActiveSheet.Hyperlinks.Add(ActiveCell, "http://www.msn.com")
h.Follow
h.Delete
ActiveCell.Clear
End Sub

the problem with this is because its writing and deleting from cells
it will prompt when you close the workbook every time a button on th
page has been clicked. I need a way of setting the hyperlink for tha
button without doing anything that would cause excel to think the shee
has been changed.

thank

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 01:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com