Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Hyperlink to a Chart

7 views
Skip to first unread message

Debra Dalgleish

unread,
Aug 1, 2003, 8:32:15 PM8/1/03
to
You can't hyperlink to a chart sheet. If the chart is embedded on a
worksheet, you could link to a named cell at the top left of the chart.

Mark Attebury wrote:
> I am trying to figure out how to create a hyperlink to a
> chart. I have one tab that is a table of contents and I
> want the reader to be able to click on the hyperlink and
> go straight to a specific chart. I can make it take them
> to various reports that I have created, but not to a chart.


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

Jon Peltier

unread,
Aug 2, 2003, 10:53:25 PM8/2/03
to
You can use a macro like this:

Sub ActivateChart()
Charts("Chart1").Activate
End Sub

Draw a rectangle in the worksheet, sized to cover the cell exactly and
formatted to look like it belongs there (or make it invisible), then
right click on the rectangle, select Assign Macro from the popup menu,
and choose the macro.

Rather than the rectangle, you can use a worksheet_selectionchange
procedure to run the ActivateChart macro:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("B2")) Is Nothing Then
ActivateChart
End If
End Sub

The above runs the macro when B2 is selected. Right click on the sheet
tab, select View Code, and paste the macro into the code window that
appears. Actually, you can bypass the ActivateChart macro with this:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("B2")) Is Nothing Then
Charts("Chart1").Activate
End If
End Sub

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

0 new messages