#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 43
Default HYPERLINKS IN VBA!!

This is what I want to do...I want to be able to create a hyperlink in a
macro AND, the most important part (because I already have successfully
created a hyperlink in a macro), RE-LINK the hyperlink to the copied and
renamed worksheet.

My code is below, it's real basic, but it's all I have so far. I'd REALLY
appreciate any help you guys could give me...thanks...

Elise


Sub Macro1()
'
Sheets("Sheet1").Select
n = Sheets.Count
Sheets("Sheet1").Copy After:=Sheets(n)
ActiveSheet.Name = InputBox("Enter the number of the new distributor.")

Sheets("Sheet1").Select
Range("A11").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=InputBox("Enter
the number of the new distributor.")
'
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default HYPERLINKS IN VBA!!

Actually you were very, very, close. Just a little tweak:

Sub Macro1()
Sheets("Sheet1").Select
n = Sheets.Count
Sheets("Sheet1").Copy After:=Sheets(n)
ActiveSheet.Name = InputBox("Enter the number of the new distributor.")
v = ActiveSheet.Name & "!A1"
Sheets("Sheet1").Select
Range("A11").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
v, TextToDisplay:=v
End Sub

--
Gary''s Student - gsnu200733


"Elise148" wrote:

This is what I want to do...I want to be able to create a hyperlink in a
macro AND, the most important part (because I already have successfully
created a hyperlink in a macro), RE-LINK the hyperlink to the copied and
renamed worksheet.

My code is below, it's real basic, but it's all I have so far. I'd REALLY
appreciate any help you guys could give me...thanks...

Elise


Sub Macro1()
'
Sheets("Sheet1").Select
n = Sheets.Count
Sheets("Sheet1").Copy After:=Sheets(n)
ActiveSheet.Name = InputBox("Enter the number of the new distributor.")

Sheets("Sheet1").Select
Range("A11").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=InputBox("Enter
the number of the new distributor.")
'
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 43
Default HYPERLINKS IN VBA!!

Is there anything I can do to keep the !A1 from showing up after I run the
macro?


"Gary''s Student" wrote:

Actually you were very, very, close. Just a little tweak:

Sub Macro1()
Sheets("Sheet1").Select
n = Sheets.Count
Sheets("Sheet1").Copy After:=Sheets(n)
ActiveSheet.Name = InputBox("Enter the number of the new distributor.")
v = ActiveSheet.Name & "!A1"
Sheets("Sheet1").Select
Range("A11").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
v, TextToDisplay:=v
End Sub

--
Gary''s Student - gsnu200733


"Elise148" wrote:

This is what I want to do...I want to be able to create a hyperlink in a
macro AND, the most important part (because I already have successfully
created a hyperlink in a macro), RE-LINK the hyperlink to the copied and
renamed worksheet.

My code is below, it's real basic, but it's all I have so far. I'd REALLY
appreciate any help you guys could give me...thanks...

Elise


Sub Macro1()
'
Sheets("Sheet1").Select
n = Sheets.Count
Sheets("Sheet1").Copy After:=Sheets(n)
ActiveSheet.Name = InputBox("Enter the number of the new distributor.")

Sheets("Sheet1").Select
Range("A11").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=InputBox("Enter
the number of the new distributor.")
'
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 43
Default HYPERLINKS IN VBA!!

Nevermind. I got it! Thanks for your help!!!

"Gary''s Student" wrote:

Actually you were very, very, close. Just a little tweak:

Sub Macro1()
Sheets("Sheet1").Select
n = Sheets.Count
Sheets("Sheet1").Copy After:=Sheets(n)
ActiveSheet.Name = InputBox("Enter the number of the new distributor.")
v = ActiveSheet.Name & "!A1"
Sheets("Sheet1").Select
Range("A11").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
v, TextToDisplay:=v
End Sub

--
Gary''s Student - gsnu200733


"Elise148" wrote:

This is what I want to do...I want to be able to create a hyperlink in a
macro AND, the most important part (because I already have successfully
created a hyperlink in a macro), RE-LINK the hyperlink to the copied and
renamed worksheet.

My code is below, it's real basic, but it's all I have so far. I'd REALLY
appreciate any help you guys could give me...thanks...

Elise


Sub Macro1()
'
Sheets("Sheet1").Select
n = Sheets.Count
Sheets("Sheet1").Copy After:=Sheets(n)
ActiveSheet.Name = InputBox("Enter the number of the new distributor.")

Sheets("Sheet1").Select
Range("A11").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=InputBox("Enter
the number of the new distributor.")
'
End Sub

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
How toi turn-off hyperlinks [excel]? Email hyperlinks pop up ! jacob735 Excel Discussion (Misc queries) 1 June 22nd 07 12:57 AM
Excel Hyperlinks- cell content v. hyperlinks herpetafauna Excel Discussion (Misc queries) 2 May 23rd 06 04:39 AM
Hyperlinks nerdman New Users to Excel 1 December 13th 05 09:43 PM
If and hyperlinks.... Frazer Excel Discussion (Misc queries) 4 August 18th 05 01:56 PM
hyperlinks mac Excel Worksheet Functions 0 April 18th 05 08:25 PM


All times are GMT +1. The time now is 02:33 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"