PC Review


Reply
Thread Tools Rate Thread

creating hyperlink using the value of the cell

 
 
Diesel
Guest
Posts: n/a
 
      5th Jan 2008
Hi there

i have a workbook that has a table of contents leading to seperate
worksheets.

on this contents page there are 3 columns that have the names of these pages
in and update automaticly. however i've found that although on my home pc
the hyperlinks changed as the page names changed, the pc at work this dosnt
happen.

what i'd like is a macro that can look at each cell in ranges A5:A68,
F5:F68, and H5:H68 and change the hyperlink to link to the sheet named the
same as the value?

for example

in cell A5 on the page "INDEX" the cell says "example" i would like the
hyperlink to link to sheet "example" cell A12.

and so on for each cell in the 3 columns.

Many thanks in advance

Dave


 
Reply With Quote
 
 
 
 
GTVT06
Guest
Posts: n/a
 
      5th Jan 2008
On Jan 5, 9:44*am, "Diesel" <b...@secret.com> wrote:
> Hi there
>
> i have a workbook that has a table of contents leading to seperate
> worksheets.
>
> on this contents page there are 3 columns that have the names of these pages
> in and update automaticly. however i've found that although on my home pc
> the hyperlinks changed as the page names changed, the pc at work this dosnt
> happen.
>
> what i'd like is a macro that can look at each cell in ranges A5:A68,
> F5:F68, and H5:H68 and change the hyperlink to link to the sheet named the
> same as the value?
>
> for example
>
> in cell A5 on the page "INDEX" the cell says "example" i would like the
> hyperlink to link to sheet "example" cell A12.
>
> and so on for each cell in the 3 columns.
>
> Many thanks in advance
>
> Dave


Sub Hyperlinks
Dim i As String
Dim cell As Range
For Each cell In Range("A5:A68,F5:F68,H5:H68")
If cell.Value <> "" Then
cell.Select
i = Selection.Value
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="",
SubAddress:= _
i & "!A12", TextToDisplay:=i
End If
Next cell
End Sub
 
Reply With Quote
 
Diesel
Guest
Posts: n/a
 
      5th Jan 2008
GTVT06, your a star.

Thank you

Dave


"GTVT06" <(E-Mail Removed)> wrote in message
news:597b4de0-2932-41e2-bff0-(E-Mail Removed)...
On Jan 5, 9:44 am, "Diesel" <b...@secret.com> wrote:
> Hi there
>
> i have a workbook that has a table of contents leading to seperate
> worksheets.
>
> on this contents page there are 3 columns that have the names of these
> pages
> in and update automaticly. however i've found that although on my home pc
> the hyperlinks changed as the page names changed, the pc at work this
> dosnt
> happen.
>
> what i'd like is a macro that can look at each cell in ranges A5:A68,
> F5:F68, and H5:H68 and change the hyperlink to link to the sheet named the
> same as the value?
>
> for example
>
> in cell A5 on the page "INDEX" the cell says "example" i would like the
> hyperlink to link to sheet "example" cell A12.
>
> and so on for each cell in the 3 columns.
>
> Many thanks in advance
>
> Dave


Sub Hyperlinks
Dim i As String
Dim cell As Range
For Each cell In Range("A5:A68,F5:F68,H5:H68")
If cell.Value <> "" Then
cell.Select
i = Selection.Value
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="",
SubAddress:= _
i & "!A12", TextToDisplay:=i
End If
Next cell
End Sub


 
Reply With Quote
 
GTVT06
Guest
Posts: n/a
 
      5th Jan 2008
On Jan 5, 11:38*am, "Diesel" <b...@secret.com> wrote:
> GTVT06, your a star.
>
> Thank you
>
> Dave
>
> "GTVT06" <gtv...@hotmail.com> wrote in message
>
> news:597b4de0-2932-41e2-bff0-(E-Mail Removed)...
> On Jan 5, 9:44 am, "Diesel" <b...@secret.com> wrote:
>
>
>
>
>
> > Hi there

>
> > i have a workbook that has a table of contents leading to seperate
> > worksheets.

>
> > on this contents page there are 3 columns that have the names of these
> > pages
> > in and update automaticly. however i've found that although on my home pc
> > the hyperlinks changed as the page names changed, the pc at work this
> > dosnt
> > happen.

>
> > what i'd like is a macro that can look at each cell in ranges A5:A68,
> > F5:F68, and H5:H68 and change the hyperlink to link to the sheet named the
> > same as the value?

>
> > for example

>
> > in cell A5 on the page "INDEX" the cell says "example" i would like the
> > hyperlink to link to sheet "example" cell A12.

>
> > and so on for each cell in the 3 columns.

>
> > Many thanks in advance

>
> > Dave

>
> Sub Hyperlinks
> *Dim i As String
> Dim cell As Range
> * * For Each cell In Range("A5:A68,F5:F68,H5:H68")
> * * If cell.Value <> "" Then
> * * cell.Select
> * * i = Selection.Value
> * * * * ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="",
> SubAddress:= _
> * * * * i & "!A12", TextToDisplay:=i
> * * End If
> * * Next cell
> End Sub- Hide quoted text -
>
> - Show quoted text -


Your Welcome. Gald I could help!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a hyperlink to a specific cell in an Excel file? janabanana Microsoft Access Getting Started 0 16th Jul 2008 05:08 PM
Creating a hyperlink to a cell on a different sheet =?Utf-8?B?Qm9i?= Microsoft Excel Worksheet Functions 1 21st Dec 2006 07:31 AM
creating hyperlink from cell data Daminc Microsoft Excel Programming 2 14th Nov 2005 02:33 PM
Creating Hyperlink in Excel and setting Cell Format Heinz Müller Microsoft C# .NET 0 8th Oct 2005 11:56 PM
Creating a hyperlink in a excel cell programatically sameershenoy Microsoft Excel Programming 0 12th May 2004 06:12 AM


Features
 

Advertising
 

Newsgroups
 


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