If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Link To Charts
Hi,
i have an excel workbook with quite a few charts in it. All the data for the charts is stored on one sheet, is there a way of creating a hyperlink for each set of data to the relevent chart? I dont fancy doing buttons for every piece of data (that would work out at well over 30 buttons!) |
#2
|
|||
|
|||
Link To Charts
Hi,
See Jon's page for details of hyperlinks. http://peltiertech.com/Excel/Hyperlinks.html Cheers Andy Lorcan Dene wrote: Hi, i have an excel workbook with quite a few charts in it. All the data for the charts is stored on one sheet, is there a way of creating a hyperlink for each set of data to the relevent chart? I dont fancy doing buttons for every piece of data (that would work out at well over 30 buttons!) -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
#3
|
|||
|
|||
Link To Charts
That worked great. How would you alter the macro for multiple sheets in the
same excel file? For example, cell b2 will take you to one worksheet, b4 will take you to another worksheet, etc. Thanks, Richard "Andy Pope" wrote: Hi, See Jon's page for details of hyperlinks. http://peltiertech.com/Excel/Hyperlinks.html Cheers Andy Lorcan Dene wrote: Hi, i have an excel workbook with quite a few charts in it. All the data for the charts is stored on one sheet, is there a way of creating a hyperlink for each set of data to the relevent chart? I dont fancy doing buttons for every piece of data (that would work out at well over 30 buttons!) -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
#4
|
|||
|
|||
Link To Charts
Hi,
Depending on the number of links you just need to duplicate the code changing the test range. If you have many cells to test then maybe, Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim rngTestTarget As Range For Each rngTestTarget In Range("B2,B4,B6").Cells If Not Intersect(Target, rngTestTarget) Is Nothing Then On Error Resume Next Charts(Target.Value).Activate If Err.Number 0 Then MsgBox "No such chart exists.", vbCritical, _ "Chart Not Found" End If On Error GoTo 0 Exit For End If Next End Sub Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Rich" wrote in message ... That worked great. How would you alter the macro for multiple sheets in the same excel file? For example, cell b2 will take you to one worksheet, b4 will take you to another worksheet, etc. Thanks, Richard "Andy Pope" wrote: Hi, See Jon's page for details of hyperlinks. http://peltiertech.com/Excel/Hyperlinks.html Cheers Andy Lorcan Dene wrote: Hi, i have an excel workbook with quite a few charts in it. All the data for the charts is stored on one sheet, is there a way of creating a hyperlink for each set of data to the relevent chart? I dont fancy doing buttons for every piece of data (that would work out at well over 30 buttons!) -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
#5
|
|||
|
|||
Link To Charts
I found another way to do it. I put buttons in with the following code
behind each of the two buttons. The first one moves over one sheet the second moves over two: Sub Macro2() ' ' Macro2 Macro ActiveSheet.Next.Select End Sub Sub Macro3() ' Macro3 Macro ActiveSheet.Next.Select ActiveSheet.Next.Select End Sub "Andy Pope" wrote: Hi, Depending on the number of links you just need to duplicate the code changing the test range. If you have many cells to test then maybe, Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim rngTestTarget As Range For Each rngTestTarget In Range("B2,B4,B6").Cells If Not Intersect(Target, rngTestTarget) Is Nothing Then On Error Resume Next Charts(Target.Value).Activate If Err.Number 0 Then MsgBox "No such chart exists.", vbCritical, _ "Chart Not Found" End If On Error GoTo 0 Exit For End If Next End Sub Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Rich" wrote in message ... That worked great. How would you alter the macro for multiple sheets in the same excel file? For example, cell b2 will take you to one worksheet, b4 will take you to another worksheet, etc. Thanks, Richard "Andy Pope" wrote: Hi, See Jon's page for details of hyperlinks. http://peltiertech.com/Excel/Hyperlinks.html Cheers Andy Lorcan Dene wrote: Hi, i have an excel workbook with quite a few charts in it. All the data for the charts is stored on one sheet, is there a way of creating a hyperlink for each set of data to the relevent chart? I dont fancy doing buttons for every piece of data (that would work out at well over 30 buttons!) -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
#6
|
|||
|
|||
Link To Charts
I tried doing this and it just says that no such chart exists.
I pasted the formula into the view code and when I select the cell B2 in the worksheet and that is all that happens. Any suggestions? I know I must be doing something wrong? -- "Andy Pope" wrote: Hi, See Jon's page for details of hyperlinks. http://peltiertech.com/Excel/Hyperlinks.html Cheers Andy Lorcan Dene wrote: Hi, i have an excel workbook with quite a few charts in it. All the data for the charts is stored on one sheet, is there a way of creating a hyperlink for each set of data to the relevent chart? I dont fancy doing buttons for every piece of data (that would work out at well over 30 buttons!) -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
#7
|
|||
|
|||
Link To Charts
The error suggests that the contents of B2 does not contain the chart sheet
name or that it is spelt incorrectly. Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Doug" wrote in message ... I tried doing this and it just says that no such chart exists. I pasted the formula into the view code and when I select the cell B2 in the worksheet and that is all that happens. Any suggestions? I know I must be doing something wrong? -- "Andy Pope" wrote: Hi, See Jon's page for details of hyperlinks. http://peltiertech.com/Excel/Hyperlinks.html Cheers Andy Lorcan Dene wrote: Hi, i have an excel workbook with quite a few charts in it. All the data for the charts is stored on one sheet, is there a way of creating a hyperlink for each set of data to the relevent chart? I dont fancy doing buttons for every piece of data (that would work out at well over 30 buttons!) -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
#8
|
|||
|
|||
Link To Charts
I have multiple charts in several sheets. I checked to make sure the chart
names match the names I have in the range B2 through B12 of my headings on the data sheet. Any more suggestions? -- "Andy Pope" wrote: The error suggests that the contents of B2 does not contain the chart sheet name or that it is spelt incorrectly. Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Doug" wrote in message ... I tried doing this and it just says that no such chart exists. I pasted the formula into the view code and when I select the cell B2 in the worksheet and that is all that happens. Any suggestions? I know I must be doing something wrong? -- "Andy Pope" wrote: Hi, See Jon's page for details of hyperlinks. http://peltiertech.com/Excel/Hyperlinks.html Cheers Andy Lorcan Dene wrote: Hi, i have an excel workbook with quite a few charts in it. All the data for the charts is stored on one sheet, is there a way of creating a hyperlink for each set of data to the relevent chart? I dont fancy doing buttons for every piece of data (that would work out at well over 30 buttons!) -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
#9
|
|||
|
|||
Link To Charts
That code example is for hyperlinking to chart sheets.
Your description of "multiple charts in several sheets" would suggest you have chartobjects on worksheets. If that's the case then you can use the HYPERLINK formula to link to a cell near the chart object. Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Doug" wrote in message ... I have multiple charts in several sheets. I checked to make sure the chart names match the names I have in the range B2 through B12 of my headings on the data sheet. Any more suggestions? -- "Andy Pope" wrote: The error suggests that the contents of B2 does not contain the chart sheet name or that it is spelt incorrectly. Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Doug" wrote in message ... I tried doing this and it just says that no such chart exists. I pasted the formula into the view code and when I select the cell B2 in the worksheet and that is all that happens. Any suggestions? I know I must be doing something wrong? -- "Andy Pope" wrote: Hi, See Jon's page for details of hyperlinks. http://peltiertech.com/Excel/Hyperlinks.html Cheers Andy Lorcan Dene wrote: Hi, i have an excel workbook with quite a few charts in it. All the data for the charts is stored on one sheet, is there a way of creating a hyperlink for each set of data to the relevent chart? I dont fancy doing buttons for every piece of data (that would work out at well over 30 buttons!) -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
Thread Tools | |
Display Modes | |
|
|