Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Using a hyperlink to find information on a different worksheet

Hi group,

I have a worksheet called League, which display a list of
Managers in my fantasy football league. I have another
worksheet called Teams, which contains the teams of the
fantasy football Managers. Each team has 11 players and
they are Grouped every 20 rows (first team begins at row 2
and 2nd team begins at rows 22 etc) and there are 85 teams
in the League.

Is it possible to create a hyerlink on the Manager name in
the League worksheet so that it automatically goes to the
Teams workskeet, finds the correct team, open the Group
and allow me to view the correct team. (Manager name
always occurs on the 1st row of a team, for example this
is first 3 rows of a sample team.)

Tony
4 Sorensen Denmark 3 0
120 G Neville England 4 0
141 Cannavaro Italy 6 0


It would be great if someone could solve this for me - it
is a popular request.

Many thanks

Tony

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Using a hyperlink to find information on a different worksheet

Tony,

This will add a hyperlink to every cell in column A of League that has a
matching name in Column A of Teams. At least it works for me ...

Sub test()

Dim league_sheet, teams_sheet As Worksheet
Dim last_row_league As Long, last_row_teams As Long
Dim r As Range
Dim mgr_name As String

Set league_sheet = Worksheets("League")
Set teams_sheet = Worksheets("Teams")

last_row_league = league_sheet.Range("A" & Rows.Count).End(xlUp).Row
last_row_teams = teams_sheet.Range("A" & Rows.Count).End(xlUp).Row

For Each r In league_sheet.Range("A1:A" & last_row_league)
mgr_name = r.Value
If Not mgr_name = "" Then 'don't add hyperlinks to blank cells
On Error Resume Next
league_sheet.Hyperlinks.Add anchor:=league_sheet.Range(r.Address),
Address:="", _
SubAddress:="Teams!" & Sheet2.Range("A1:A" &
last_row_teams).Find(mgr_name).Address, _
TextToDisplay:=mgr_name
If Err < 0 Then
r.Value = mgr_name 'if can't find a link then revert to original
value
End If
On Error GoTo 0
End If
Next r

End Sub


hth,

Doug

"Tony" wrote in message
...
Hi group,

I have a worksheet called League, which display a list of
Managers in my fantasy football league. I have another
worksheet called Teams, which contains the teams of the
fantasy football Managers. Each team has 11 players and
they are Grouped every 20 rows (first team begins at row 2
and 2nd team begins at rows 22 etc) and there are 85 teams
in the League.

Is it possible to create a hyerlink on the Manager name in
the League worksheet so that it automatically goes to the
Teams workskeet, finds the correct team, open the Group
and allow me to view the correct team. (Manager name
always occurs on the 1st row of a team, for example this
is first 3 rows of a sample team.)

Tony
4 Sorensen Denmark 3 0
120 G Neville England 4 0
141 Cannavaro Italy 6 0


It would be great if someone could solve this for me - it
is a popular request.

Many thanks

Tony



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Using a hyperlink to find information on a different worksheet

Hi Doug,

Very clever - worked a treat.

Mamy thanks

Tony

-----Original Message-----
Tony,

This will add a hyperlink to every cell in column A of

League that has a
matching name in Column A of Teams. At least it works

for me ...

Sub test()

Dim league_sheet, teams_sheet As Worksheet
Dim last_row_league As Long, last_row_teams As Long
Dim r As Range
Dim mgr_name As String

Set league_sheet = Worksheets("League")
Set teams_sheet = Worksheets("Teams")

last_row_league = league_sheet.Range("A" & Rows.Count).End

(xlUp).Row
last_row_teams = teams_sheet.Range("A" & Rows.Count).End

(xlUp).Row

For Each r In league_sheet.Range("A1:A" & last_row_league)
mgr_name = r.Value
If Not mgr_name = "" Then 'don't add hyperlinks to

blank cells
On Error Resume Next
league_sheet.Hyperlinks.Add

anchor:=league_sheet.Range(r.Address),
Address:="", _
SubAddress:="Teams!" & Sheet2.Range("A1:A" &
last_row_teams).Find(mgr_name).Address, _
TextToDisplay:=mgr_name
If Err < 0 Then
r.Value = mgr_name 'if can't find a link then

revert to original
value
End If
On Error GoTo 0
End If
Next r

End Sub


hth,

Doug

"Tony" wrote in

message
...
Hi group,

I have a worksheet called League, which display a list

of
Managers in my fantasy football league. I have another
worksheet called Teams, which contains the teams of the
fantasy football Managers. Each team has 11 players and
they are Grouped every 20 rows (first team begins at

row 2
and 2nd team begins at rows 22 etc) and there are 85

teams
in the League.

Is it possible to create a hyerlink on the Manager name

in
the League worksheet so that it automatically goes to

the
Teams workskeet, finds the correct team, open the Group
and allow me to view the correct team. (Manager name
always occurs on the 1st row of a team, for example this
is first 3 rows of a sample team.)

Tony
4 Sorensen Denmark 3 0
120 G Neville England 4 0
141 Cannavaro Italy 6 0


It would be great if someone could solve this for me -

it
is a popular request.

Many thanks

Tony



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Using a hyperlink to find information on a different worksheet

Tony,

I'm glad it worked for you. I learned some stuff figuring it out.

Doug

"Tony" wrote in message
...
Hi Doug,

Very clever - worked a treat.

Mamy thanks

Tony

-----Original Message-----
Tony,

This will add a hyperlink to every cell in column A of

League that has a
matching name in Column A of Teams. At least it works

for me ...

Sub test()

Dim league_sheet, teams_sheet As Worksheet
Dim last_row_league As Long, last_row_teams As Long
Dim r As Range
Dim mgr_name As String

Set league_sheet = Worksheets("League")
Set teams_sheet = Worksheets("Teams")

last_row_league = league_sheet.Range("A" & Rows.Count).End

(xlUp).Row
last_row_teams = teams_sheet.Range("A" & Rows.Count).End

(xlUp).Row

For Each r In league_sheet.Range("A1:A" & last_row_league)
mgr_name = r.Value
If Not mgr_name = "" Then 'don't add hyperlinks to

blank cells
On Error Resume Next
league_sheet.Hyperlinks.Add

anchor:=league_sheet.Range(r.Address),
Address:="", _
SubAddress:="Teams!" & Sheet2.Range("A1:A" &
last_row_teams).Find(mgr_name).Address, _
TextToDisplay:=mgr_name
If Err < 0 Then
r.Value = mgr_name 'if can't find a link then

revert to original
value
End If
On Error GoTo 0
End If
Next r

End Sub


hth,

Doug

"Tony" wrote in

message
...
Hi group,

I have a worksheet called League, which display a list

of
Managers in my fantasy football league. I have another
worksheet called Teams, which contains the teams of the
fantasy football Managers. Each team has 11 players and
they are Grouped every 20 rows (first team begins at

row 2
and 2nd team begins at rows 22 etc) and there are 85

teams
in the League.

Is it possible to create a hyerlink on the Manager name

in
the League worksheet so that it automatically goes to

the
Teams workskeet, finds the correct team, open the Group
and allow me to view the correct team. (Manager name
always occurs on the 1st row of a team, for example this
is first 3 rows of a sample team.)

Tony
4 Sorensen Denmark 3 0
120 G Neville England 4 0
141 Cannavaro Italy 6 0


It would be great if someone could solve this for me -

it
is a popular request.

Many thanks

Tony



.



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 to website and then to information in a certain cell Ernie[_2_] Excel Worksheet Functions 6 November 11th 09 07:19 PM
Old hyperlink information in a block, not what is currently there Philophil Excel Discussion (Misc queries) 4 September 12th 06 12:36 AM
Hyperlink - cannot download the information you requested TheRanz Excel Discussion (Misc queries) 2 August 22nd 05 05:34 PM
copy the underlying e-mail hyperlink information... John87111 Excel Discussion (Misc queries) 4 April 29th 05 10:33 PM
How do I copy the underlying e-mail hyperlink information from a . John87111 Excel Discussion (Misc queries) 3 April 26th 05 05:05 PM


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