#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Hyperlink Questions

I have a macro that adds a new named tab for each name a list range. I need
to add a code to my macro that will add a hyperlink next to each name in the
range which will take me directly to the page. My current code is below.
Can anyone help? Below is the macro. Can anyone add to it?

Sub name_sheets()
'will add a sheet, and name it
'for each name in column A
'from A1 down till it hits a blank row
Dim Rng As Range
Dim ListRng As Range

Set ListRng = Range(Range("C6"), Range("C6").End(xlDown))


For Each Rng In ListRng
If Rng.Text < "" And Rng.EntireRow.Hidden = False And Rng.Text < "Buy
/ Sale" _
And Rng.Text < "Buy/Sale" Then
With Worksheets
.Add(after:=.Item(.Count)).Name = Rng.Text

End With


End If
Next Rng
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 273
Default Hyperlink Questions

try something like this in your code:
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"Sheet2!A1", TextToDisplay:="Sheet2!A1"

"David T" wrote:

I have a macro that adds a new named tab for each name a list range. I need
to add a code to my macro that will add a hyperlink next to each name in the
range which will take me directly to the page. My current code is below.
Can anyone help? Below is the macro. Can anyone add to it?

Sub name_sheets()
'will add a sheet, and name it
'for each name in column A
'from A1 down till it hits a blank row
Dim Rng As Range
Dim ListRng As Range

Set ListRng = Range(Range("C6"), Range("C6").End(xlDown))


For Each Rng In ListRng
If Rng.Text < "" And Rng.EntireRow.Hidden = False And Rng.Text < "Buy
/ Sale" _
And Rng.Text < "Buy/Sale" Then
With Worksheets
.Add(after:=.Item(.Count)).Name = Rng.Text

End With


End If
Next Rng
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Hyperlink Questions

Hey Chad...it's adding a hyperlink to all the worksheets, but not the index
page.

"David T" wrote:

I have a macro that adds a new named tab for each name a list range. I need
to add a code to my macro that will add a hyperlink next to each name in the
range which will take me directly to the page. My current code is below.
Can anyone help? Below is the macro. Can anyone add to it?

Sub name_sheets()
'will add a sheet, and name it
'for each name in column A
'from A1 down till it hits a blank row
Dim Rng As Range
Dim ListRng As Range

Set ListRng = Range(Range("C6"), Range("C6").End(xlDown))


For Each Rng In ListRng
If Rng.Text < "" And Rng.EntireRow.Hidden = False And Rng.Text < "Buy
/ Sale" _
And Rng.Text < "Buy/Sale" Then
With Worksheets
.Add(after:=.Item(.Count)).Name = Rng.Text

End With


End If
Next Rng
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 273
Default Hyperlink Questions

I'm going to need a little more information on this to provide more info on
your code and incorporating this addition of a hyperlink. thanks.

"David T" wrote:

Hey Chad...it's adding a hyperlink to all the worksheets, but not the index
page.

"David T" wrote:

I have a macro that adds a new named tab for each name a list range. I need
to add a code to my macro that will add a hyperlink next to each name in the
range which will take me directly to the page. My current code is below.
Can anyone help? Below is the macro. Can anyone add to it?

Sub name_sheets()
'will add a sheet, and name it
'for each name in column A
'from A1 down till it hits a blank row
Dim Rng As Range
Dim ListRng As Range

Set ListRng = Range(Range("C6"), Range("C6").End(xlDown))


For Each Rng In ListRng
If Rng.Text < "" And Rng.EntireRow.Hidden = False And Rng.Text < "Buy
/ Sale" _
And Rng.Text < "Buy/Sale" Then
With Worksheets
.Add(after:=.Item(.Count)).Name = Rng.Text

End With


End If
Next Rng
End Sub

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Hyperlink Questions

Hey Chad-

i have a list of states in column "B" with different cities related to the
names in column "C". I can filter the list by the different states. My
macro (at the bottom of the email) creates a new worksheet for each city .
I need my macro to add a hyperlink to each contract # (in column D) which
will take me directly to the sheet which was created for the city

I thank you in advance for your help

Column B Column C Column D
Names Cities Hyperlink

New York Albany (need hyper link to take me to WS "Albany")
New York New York
New York Long Island
New York Manhattan
Texas Houston
Texas Austin
Texas San Antonio


"David T" wrote:

I have a macro that adds a new named tab for each name a list range. I need
to add a code to my macro that will add a hyperlink next to each name in the
range which will take me directly to the page. My current code is below.
Can anyone help? Below is the macro. Can anyone add to it?

Sub name_sheets()
'will add a sheet, and name it
'for each name in column A
'from A1 down till it hits a blank row
Dim Rng As Range
Dim ListRng As Range

Set ListRng = Range(Range("C6"), Range("C6").End(xlDown))


For Each Rng In ListRng
If Rng.Text < "" And Rng.EntireRow.Hidden = False And Rng.Text < "Buy
/ Sale" _
And Rng.Text < "Buy/Sale" Then
With Worksheets
.Add(after:=.Item(.Count)).Name = Rng.Text

End With


End If
Next Rng
End Sub



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 273
Default Hyperlink Questions

based upon the data you provided, try something like this after you create
the sheet for the city:

'make sure you are on the index worksheet with all the cities
linkname = Range("C2").Value 'city name
linkrange = linkname & "!A1" 'link to city worksheet
Range("D2").Select 'where you want the link to be
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
linkrange, TextToDisplay:=linkname


let me know how this works!
-chad


"David T" wrote:

Hey Chad-

i have a list of states in column "B" with different cities related to the
names in column "C". I can filter the list by the different states. My
macro (at the bottom of the email) creates a new worksheet for each city .
I need my macro to add a hyperlink to each contract # (in column D) which
will take me directly to the sheet which was created for the city

I thank you in advance for your help

Column B Column C Column D
Names Cities Hyperlink

New York Albany (need hyper link to take me to WS "Albany")
New York New York
New York Long Island
New York Manhattan
Texas Houston
Texas Austin
Texas San Antonio


"David T" wrote:

I have a macro that adds a new named tab for each name a list range. I need
to add a code to my macro that will add a hyperlink next to each name in the
range which will take me directly to the page. My current code is below.
Can anyone help? Below is the macro. Can anyone add to it?

Sub name_sheets()
'will add a sheet, and name it
'for each name in column A
'from A1 down till it hits a blank row
Dim Rng As Range
Dim ListRng As Range

Set ListRng = Range(Range("C6"), Range("C6").End(xlDown))


For Each Rng In ListRng
If Rng.Text < "" And Rng.EntireRow.Hidden = False And Rng.Text < "Buy
/ Sale" _
And Rng.Text < "Buy/Sale" Then
With Worksheets
.Add(after:=.Item(.Count)).Name = Rng.Text

End With


End If
Next Rng
End Sub

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Hyperlink Questions

hey chad

Thanks for your help. It works just fine

"David T" wrote:

I have a macro that adds a new named tab for each name a list range. I need
to add a code to my macro that will add a hyperlink next to each name in the
range which will take me directly to the page. My current code is below.
Can anyone help? Below is the macro. Can anyone add to it?

Sub name_sheets()
'will add a sheet, and name it
'for each name in column A
'from A1 down till it hits a blank row
Dim Rng As Range
Dim ListRng As Range

Set ListRng = Range(Range("C6"), Range("C6").End(xlDown))


For Each Rng In ListRng
If Rng.Text < "" And Rng.EntireRow.Hidden = False And Rng.Text < "Buy
/ Sale" _
And Rng.Text < "Buy/Sale" Then
With Worksheets
.Add(after:=.Item(.Count)).Name = Rng.Text

End With


End If
Next Rng
End Sub

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 273
Default Hyperlink Questions

thanks for the feedback. glad it worked.

"David T" wrote:

hey chad

Thanks for your help. It works just fine

"David T" wrote:

I have a macro that adds a new named tab for each name a list range. I need
to add a code to my macro that will add a hyperlink next to each name in the
range which will take me directly to the page. My current code is below.
Can anyone help? Below is the macro. Can anyone add to it?

Sub name_sheets()
'will add a sheet, and name it
'for each name in column A
'from A1 down till it hits a blank row
Dim Rng As Range
Dim ListRng As Range

Set ListRng = Range(Range("C6"), Range("C6").End(xlDown))


For Each Rng In ListRng
If Rng.Text < "" And Rng.EntireRow.Hidden = False And Rng.Text < "Buy
/ Sale" _
And Rng.Text < "Buy/Sale" Then
With Worksheets
.Add(after:=.Item(.Count)).Name = Rng.Text

End With


End If
Next Rng
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
Can't make hyperlink function work for hyperlink to website Frank B Denman Excel Worksheet Functions 15 February 5th 07 11:01 PM
How do I create a hyperlink to a cell with the hyperlink function S. Bevins Excel Worksheet Functions 2 July 20th 06 08:06 PM
Moving rows with Hyperlink doesn't move hyperlink address Samad Excel Discussion (Misc queries) 15 June 22nd 06 12:03 PM
EXCEL Hyperlink to Charts Questions.. URGENT.. =( kaci Excel Discussion (Misc queries) 4 August 1st 05 02:34 PM
Intra-workbook hyperlink: macro/function to return to hyperlink ce marika1981 Excel Discussion (Misc queries) 3 May 6th 05 05:47 AM


All times are GMT +1. The time now is 03:55 AM.

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

About Us

"It's about Microsoft Excel"