Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Using a cell to open an existing worksheet in Excel

Posted on 2011-03-14
4
Medium Priority
?
320 Views
Last Modified: 2012-05-11
Is there a way that when a user would click on a cell, that it could open an existing worksheet within the same file?  Instead of having the user find the correct worksheet, a master list could be created and displayed, and then the user would just 'click' the one they wanted?  If so, how could it be done.  If not, thanks for letting me know.
0
Comment
Question by:rivercity
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
AustinComputerLabs earned 2000 total points
ID: 35132489
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35132608
If n a workbook you right click on a tab and select view code.  Now insert  a code module and post the following snippet.

When you run the code it will create a new sheet as a table of contents with hyperlinks automatically

Chris
Sub Hyper()
Dim TOC As Worksheet
Dim sh As Object

    On Error Resume Next
    Set TOC = ThisWorkbook.Worksheets("TOC")
    On Error GoTo 0
    If TOC Is Nothing Then
        Set TOC = ThisWorkbook.Worksheets.Add(Before:=ThisWorkbook.Sheets(1))
        TOC.Name = "TOC"
    End If
    TOC.Move Before:=ThisWorkbook.Sheets(1)
    TOC.Cells.Delete
    TOC.Range("A1") = "Worksheet(s)"
    For Each sh In ThisWorkbook.Worksheets
'        TOC.Range("a" & TOC.Rows.Count).End(xlUp).Offset(1, 0) = sh.Name
        TOC.Hyperlinks.Add Anchor:=TOC.Range("a" & TOC.Rows.Count).End(xlUp).Offset(1, 0), _
            Address:="", SubAddress:=VBA.Chr(39) & sh.Name & VBA.Chr(39) & "!A1"
    Next
    TOC.Columns(1).AutoFit

End Sub

Open in new window

0
 

Author Closing Comment

by:rivercity
ID: 35133300
sometimes it's just hard to find the right things.

works perfect.
0
 
LVL 13

Expert Comment

by:AustinComputerLabs
ID: 35133310
Thank you for your support.
Master Certification obtained with your answer!!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question