Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update Autoshape's Hyperlink
Hello All,
I have a series of autoshapes with hyperlinks and I'm trying create a macro which will update the hyperlinks. Here are the requirements: 1) User enters a variable in a dialog box 2) The variable captured will be used in the link (variable = x) 2) Macro updates the autoshape "Autoshape3" replaces old link with the new link "http://example.com/subscription.asp&refID=x" I've been trying to search for the right code to update the autoshapes with the new link, but haven't been able to find it. Thanks for all your help. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update Autoshape's Hyperlink
Option Explicit
Sub test() Dim aWS as Worksheet Dim myShape As Shape Set aWS = ActiveSheet on error resume next set myShape = aWS.shapes("Autoshape3") on error goto 0 if not myShape is nothing then myShape.Hyperlink.Address = + "http://example.com/subscription.asp&refID=x" End If End Sub HTH, Barb Reinhardt "Max" wrote: Hello All, I have a series of autoshapes with hyperlinks and I'm trying create a macro which will update the hyperlinks. Here are the requirements: 1) User enters a variable in a dialog box 2) The variable captured will be used in the link (variable = x) 2) Macro updates the autoshape "Autoshape3" replaces old link with the new link "http://example.com/subscription.asp&refID=x" I've been trying to search for the right code to update the autoshapes with the new link, but haven't been able to find it. Thanks for all your help. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update Autoshape's Hyperlink
Hello Barb,
Thanks for the quick response. The code you provided helps me update the link. I would also like to have the user enter a number in a dialog box, have that number set as a variable to change the X in the hyperlink. Thanks for your help. "Barb Reinhardt" wrote: Option Explicit Sub test() Dim aWS as Worksheet Dim myShape As Shape Set aWS = ActiveSheet on error resume next set myShape = aWS.shapes("Autoshape3") on error goto 0 if not myShape is nothing then myShape.Hyperlink.Address = + "http://example.com/subscription.asp&refID=x" End If End Sub HTH, Barb Reinhardt "Max" wrote: Hello All, I have a series of autoshapes with hyperlinks and I'm trying create a macro which will update the hyperlinks. Here are the requirements: 1) User enters a variable in a dialog box 2) The variable captured will be used in the link (variable = x) 2) Macro updates the autoshape "Autoshape3" replaces old link with the new link "http://example.com/subscription.asp&refID=x" I've been trying to search for the right code to update the autoshapes with the new link, but haven't been able to find it. Thanks for all your help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hyperlink Update | Excel Worksheet Functions | |||
Update hyperlink value with cell value | Excel Programming | |||
Hyperlink Update? | Excel Discussion (Misc queries) | |||
Global update hyperlink address | Setting up and Configuration of Excel | |||
Follow hyperlink but don't update links....is it possible ? | Excel Programming |