LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Making Hyperlinks from a list of sheet names

Hi Don

Thanks for your response. Ive followed your instructions, but the code
either doesnt work or falls over on the call for GetWorkbook. I think that
I might be missing something.

Since I dont have that code for GetWorkbook why do I need it the call?

I think that the final line of code puts the cursor in Cell A4 of the
activated sheet, I think that I can change this to any other cell, is that
true?
Regards


"Don Guillett" wrote:

Why bother. Just put this code in the sheet module where the list is and
double click on the typed name such as

sheet7

to goto shee7

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Application.DisplayAlerts = False
Dim WantedSheet As String
WantedSheet = Trim(ActiveCell.Value)
If WantedSheet = "" Then Exit Sub
On Error Resume Next
If Sheets(ActiveCell.Value) Is Nothing Then
GetWorkbook ' calls another macro to do that
Else
Sheets(ActiveCell.Value).Select
ActiveSheet.Range("a4").Select
End If
Application.DisplayAlerts = True
End Sub

--
Don Guillett
SalesAid Software

"Philip J Smith" wrote in message
...
Hi.

Could some-one point out the error in the following code please?

I have used the code below to convert sheet names listed as lables into
hyperlinks, modifications noted in text. As the code was designed to
convert
file links to hyperlinks rather than Worksheet names I have attempted to
modify it.

When run the code formats the lables as hyperlinks, but when I try to
follow
the link the following error message appears.

"Reference is not Valid"

The worksheets are in the same workbook as their list. I have hardcoded
the
workbook name, dangerous I know but I will sort that out once I get the
code
working.

Regards

Phil
----------------------
Sub MakeHyperlinks_B()
'Copied from
http://www.mvps.org/dmcritchie/excel...MakeHyperLinks
'on 15 March 2007.
'Modified so that the range is in column B rather than D
'SubAddress Added to ActiveSheet.Hyperlinks
Dim cell As Range, Rng As Range
Set Rng = Range("B2:B" & Cells.Rows.Count). _
SpecialCells(xlConstants, xlTextValues)
If Rng Is Nothing Then
MsgBox "nothing in range"
Exit Sub
End If
For Each cell In Rng
If Trim(cell.Value) < "" Then
ActiveSheet.Hyperlinks.Add Anchor:=cell, _
Address:="SummaryBilledByMonth.xls", _
SubAddress:=cell.Value, _
ScreenTip:=cell.Value, _
TextToDisplay:=cell.Value
End If
Next cell
End Sub
---------------------------




 
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
Making a list of discrete numbers (names?) and occurences of each partsman_ba New Users to Excel 10 August 22nd 09 03:02 PM
List sheet names StevenP Excel Programming 13 July 31st 06 08:33 PM
how do i set up a list of names on a sheet frm various sheets in e mcvities_69 Excel Discussion (Misc queries) 1 January 27th 06 02:51 AM
Making folders based on list of names [email protected] Excel Programming 1 December 6th 05 10:18 AM
Putting Sheet Names on a list arcq Excel Programming 3 March 9th 05 02:49 PM


All times are GMT +1. The time now is 10:20 PM.

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"