hyperlinks

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Hyperlinks

Hyperlinks

resolvedResolved · Low Priority · Version 2007

Tom has attended:
Excel VBA Intro Intermediate course
Excel Advanced course
Excel VBA Advanced course
Access Introduction course

Hyperlinks

I want to make navigation around a spreadsheet easier, and have tried to to achieve that using hyperlinks. I have an index sheet to each sheet in the book, which works fine. What I then want is smaller lists of sheet names, (not all of them), with a hyperlink for each one to that sheet. I can do this one by one, but want to write code so as to navigate in each case to the sheet with the name in the anchor cell. How can I do this please?

RE: hyperlinks

Hi Tom

Further to your post you are on the right track with regards to coding a solution. We are confident a solution can be found however it will be beyond the capabilities of this forum.

The approach to take would be to review your working files along with a mock up you have prepared for our guidance. We can then confirm how we will go about creating the solution, time required and related costs. This shouldn't take more than a half day but we will have a better idea once we have reviewed your files.

If you would like to progress this option then please do let us know.

Kind regards
Jacob

RE: hyperlinks

Thanks, Jacob.

Could you advise please:

(i) what qualifies as within the scope of the forum in terms of getting free support, and what does not; and

(ii) the rates at which work outside that scope would be chargeable.

Thanks,

tom

RE: hyperlinks

Hi Tom

This is the sub-routine I use to create an index of worksheets:

Sub ContentsSheet()

'This Creates a List of Worksheets, together with a Hyperlink to each one

Sheets("Index").Select
Range("A1").Select

Dim DoIt
Dim MySheetName

'ScreenUpdating = False

Range("A1").Select
'DoIt = MsgBox("Have you clicked in the cell where you want your contents list to start?", vbYesNo, "Create a contents list")

'If DoIt = vbYes Then
For I = 1 To Worksheets.Count
ActiveCell.Value = Worksheets(I).Name
ActiveCell.Offset(0, 1).Select

MySheetName = "'" & Worksheets(I).Name & "'!A1"

ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:=MySheetName

ActiveCell.FormulaR1C1 = Worksheets(I).Name
ActiveCell.Offset(1, -1).Select
Next I
'End If

Range("A1").Select

ScreenUpdating = True

End Sub

I use the following formula to enter the worksheet name into cell A1 on each sheet (but of course you could use this in any cel):
=RIGHT((CELL("filename",$A$1)),LEN(CELL("filename",$A$1))-FIND("]",(CELL("filename",$A$1))))

Please let me know if this is of any help to you.

I also use a couple of other sub-routines to sort the worksheets into alphabetical order and to place the 'Index' woksheet as 'Sheet 1' - the first sheet in the workbook.

Good Luck,

John

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Changing Excel file and worksheet defaults

The appearance of any new Excel files or any new worksheets that are inserted into a file are controlled by two template files, Book.xlt and Sheet.xlt.

By opening, modifying and saving these templates you can change the default settings for all new files and/or all newly inserted sheets.

Use Book.xlt to make change to defaults for new workbooks; and Sheet.xlt to change defaults for sheets.

If you can't find either of these files on your computer, you can create and save them yourself.

You can do this simply by creating a new workbook with the setting you want to use as your defaults; then saving them with the appropriate name in the XLStart folder. If you are using Office 2003, this is usually found in C:\Program Files\Microsoft Office\Office11\XLStart.

View all Excel hints and tips


Server loaded in 0.08 secs.