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
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
_______