Code mod to add name

P

Phil Hageman

This code puts a neat box on screen with the name of the
worksheet and a list of the charts - by name:

Sub ListCharts()
Dim msg As String
Dim chtob As ChartObject
msg = ActiveSheet.Name & vbCrLf
For Each chtob In ActiveSheet.ChartObjects
msg = msg & vbCrLf & chtob.Name
Next
MsgBox msg
End Sub

What modification would put the chart title after the
chart name?

Thanks,Phil
 
C

Chip Pearson

Phil,

Try

msg = msg & vbCrLf & chtob.Name & " " & chtob.Chart.ChartTitle.Caption

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
P

Patrick Molloy

For Each chtob In ActiveSheet.ChartObjects
msg = msg & vbCrLf & _
chtob.Name & " : " & _
chtob.Chart.ChartTitle.Caption
Next


Patrick Molloy
Microsoft Excel MVP
 
P

Phil Hageman

Thanks, Patrick - yours and Chip's were nearly the same.
Appriciate your response. Phil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top