Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
List Charts Macro
This sub creates a message box listing worksheet charts, by chart number. Can the code be modified to show the chart title after the chart name
Sub ListCharts( Dim Msg As Strin Dim ChtObj As ChartObjec Msg = "Worksheet: " & ActiveSheet.Name & vbCrL For Each ChtObj In ActiveSheet.ChartObject Msg = Msg & vbCrLf & ChtObj.Nam Nex MsgBox Ms End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
List Charts Macro
Hi Phil,
Try this, Sub ListCharts() Dim Msg As String Dim ChtObj As ChartObject Msg = "Worksheet: " & ActiveSheet.Name & vbCrLf For Each ChtObj In ActiveSheet.ChartObjects If ChtObj.Chart.HasTitle Then Msg = Msg & vbCrLf & ChtObj.Name & " " & ChtObj.Chart.ChartTitle.Text Else Msg = Msg & vbCrLf & ChtObj.Name End If Next MsgBox Msg End Sub Cheers Andy Phil Hageman wrote: This sub creates a message box listing worksheet charts, by chart number. Can the code be modified to show the chart title after the chart name? Sub ListCharts() Dim Msg As String Dim ChtObj As ChartObject Msg = "Worksheet: " & ActiveSheet.Name & vbCrLf For Each ChtObj In ActiveSheet.ChartObjects Msg = Msg & vbCrLf & ChtObj.Name Next MsgBox Msg End Sub -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
List Charts Macro
http://support.microsoft.com/?id=177760
VBA: How to Run Macros in Other Office Programs http://support.microsoft.com/?id=210111 ACC2000: Using Microsoft Access as an Automation Server http://support.microsoft.com/?id=253338 INFO: Office Developer Samples and Tools Available for Download http://support.microsoft.com/?id=260410 OFF2000: Microsoft Office 2000 Automation Help File Available -- Regards, Tom Ogilvy "Phil Hageman" wrote in message ... This sub creates a message box listing worksheet charts, by chart number. Can the code be modified to show the chart title after the chart name? Sub ListCharts() Dim Msg As String Dim ChtObj As ChartObject Msg = "Worksheet: " & ActiveSheet.Name & vbCrLf For Each ChtObj In ActiveSheet.ChartObjects Msg = Msg & vbCrLf & ChtObj.Name Next MsgBox Msg End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
List Charts Macro
Hi Phil,
Hopefully its just a line wrapping problem. Msg = Msg & vbCrLf & ChtObj.Name & _ " " & ChtObj.Chart.ChartTitle.Text Cheers Andy Phil Hageman wrote: Andy, Thanks for your reply. When running the code, I get a Compile error: syntax error on the line: Msg = Msg & vbCrLf & ChtObj.Name & " " & Thanks, Phil -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
List Charts Macro
Thanks, Andy. Works great
Phil |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Charts using List Feature | Excel Discussion (Misc queries) | |||
Is there a list of names for the various charts... | Charts and Charting in Excel | |||
How do I set up charts with a drop-down list? | Excel Discussion (Misc queries) | |||
Adding titels to charts from a list | Charts and Charting in Excel | |||
List Charts in a Worksheet | Excel Programming |