Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 390
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default 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   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 390
Default 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
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
Hyperlink Update Douglas Excel Worksheet Functions 0 September 18th 08 08:31 AM
Update hyperlink value with cell value Bert Excel Programming 4 August 28th 07 07:40 AM
Hyperlink Update? gatz Excel Discussion (Misc queries) 0 June 5th 07 08:19 PM
Global update hyperlink address j Setting up and Configuration of Excel 1 February 7th 07 04:58 AM
Follow hyperlink but don't update links....is it possible ? nx3 Excel Programming 1 June 16th 06 03:51 PM


All times are GMT +1. The time now is 08:46 PM.

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

About Us

"It's about Microsoft Excel"