View Single Post
  #4   Report Post  
George
 
Posts: n/a
Default

Thank you for the response. I saw a similar idea posted on the FAQ section
of this board, but it is only good for one link. If I try to load VBE code
for more than one link, the code tells me I cannot do that. I have duplicate
code. I am not a Basic language user, so I do not know if I can circumvent
this issue. I need to specify several links on the "index" sheet. I have 80
charts to pick from. The index makes sense for organization. I have already
started to re-locate all charts as objects in other worksheets. If you can
think of another approach, I'd love to hear it. Wonder why Excel is set up
this way? Is this an idea that should be proposed to Microsoft?

"Gary Brown" wrote:

George,
I couldn't think of a straight-forward way to do this so I came up with a
work-around. For all I know, there may be a really simple way of doing what
you ask but I don't know.
What I came up with is a bit cumbersome, involves some VBA code but it
does work. Here's my example.

Assumptions...
- the name of the workbook is 'MyCharts.xls'
- the index worksheet is called 'Sheet1'
- the cell where the hyperlink goes is 'B1'
- the chart sheet is called 'Chart1'

[remember, whereever it says one of the above assumption names, change it to
your real-life name]

1) Create a hyperlink in 'Sheet1 in cell 'B1' by going to cell 'B1' and
then selecting INSERT / HYPERLINK
2) In the 'Type the Cell Reference' textbox, type "B1". This way when it
is clicked it will hyperlink to itself.
3) In the 'Text to Display' textbox, type "Chart1"
4) Paste VBA code into the Sheet1 module.
- Select TOOLS / MACRO / VISUAL BASIC EDITOR
- In the upper right hand window, you will see the 'Project' window.
- Look for 'MyCharts.xls'
- Double-click on 'MyCharts.xls' and a large blank window will open up to
the right of the 'Project Window'
- Paste the following code into that window
'/====Start of Code===================/
Private Sub Worksheet_FollowHyperlink(ByVal _
Target As Hyperlink)
If ActiveCell.Value = "Chart1" Then
Sheets("Chart1").Select
End If
End Sub

'/======End of Code===================/
5) Select FILE / CLOSE AND RETURN TO MICROSOFT EXCEL
6) Save your workbook

What this does...
Every time a hyperlink is pressed on Sheet1 (only), the VBA code checks to
see if that hyperlink says 'Chart1'. If it doesn't, nothing happens. If it
DOES say 'Chart1', then the worksheet called Chart1 is selected.

HTH,
Gary Brown


"George" wrote in message
...
I am using a workbook on a website. I am using the first sheet as an index
to other sheets. I need to set up a hyperlink from a cell in my index
sheet
to a chart that is its own sheet, not embedded in another work sheet. How
can I do this?

Thanks,
George