Forum Discussion
Edward Moller
Jan 23, 2018Copper Contributor
Hyperlink to a chart (not to a cell coordinate)
Good morning. Our firm concentrates on providing training for people with disabilities, and I have been developing Excel tools that allow visually impaired individuals to access spreadsheets using t...
JKPieterse
Jan 23, 2018Silver Contributor
Assuming you point each hyperlink to the top-left cell below each chart you could place this code in the ThisWorkbook module to have the chart floating with its top-left corenr on top of that cell selected:
Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target As Hyperlink)
Dim oShp As Shape
For Each oShp In Sh.Shapes
If oShp.TopLeftCell.Address = Sh.Range(Target.SubAddress).Address Then
oShp.Select
Exit For
End If
Next
End Sub
Edward Moller
Jan 23, 2018Copper Contributor
Hi Jan,
Thank you for the quick reply and solution. I must admit however that you have me at a disadvantage. I don't know what you mean by placing a code in the ThisWorkbook module. Would you be able to provide me with further guidance? Thanks.
Best,
Ed
- JKPieterseJan 23, 2018Silver ContributorRight-click any sheet's tab and select "View Code". Now the VBA editor of Excel opens. On the left you should see a small window which is called "Project Explorer". In that window yu should see a small folder-like structure with the name of your workbook in there somewhere. Under that project you should have a folder called "Microsoft Excel Objects" andone of the subitems there is "ThisWorkbook". Double-click that item. Then paste my code in the window that just opened.
Mind you, after doing so, save-as your file as Excel workbook with macro's.- Edward MollerJan 23, 2018Copper Contributor
Jan,
That worked! Thank you so much.
Best,
Ed