Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
George
 
Posts: n/a
Default Hyperlink to a chart...

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

  #2   Report Post  
Gary Brown
 
Posts: n/a
Default

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



  #3   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

You can't hyperlink to the chart sheet, but Jon Peltier has a macro
workaround in his Charting FAQ article:

http://pubs.logicalexpressions.com/P...?ID=209#jon016

that you may be able to use.


George wrote:
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



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #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




Reply
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
Editing a Chart Directly?? Charisma Riley Charts and Charting in Excel 3 January 26th 05 01:09 PM
Editing a Chart Directly?? CJ Charts and Charting in Excel 2 January 24th 05 08:15 PM
Problem with xlusrgal.xls file Alfred S C Lee Charts and Charting in Excel 2 December 29th 04 05:54 PM
pivot table multi line chart souris Charts and Charting in Excel 2 December 7th 04 03:56 AM
Why do my text boxes disappear from my chart when I click out? Robboo Charts and Charting in Excel 1 November 27th 04 05:49 PM


All times are GMT +1. The time now is 07:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"