ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code mod to add name (https://www.excelbanter.com/excel-programming/281803-code-mod-add-name.html)

Phil Hageman[_3_]

Code mod to add name
 
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

Chip Pearson

Code mod to add name
 
Phil,

Try

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

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Phil Hageman" wrote in message
...
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




patrick molloy

Code mod to add name
 

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


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
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
.


Phil Hageman[_3_]

Thanks
 
Thanks, Chip - works great!
-----Original Message-----
Phil,

Try

msg = msg & vbCrLf & chtob.Name & " " &

chtob.Chart.ChartTitle.Caption

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Phil Hageman"

wrote in message
...
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



.


Phil Hageman[_3_]

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

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


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
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
.

.



All times are GMT +1. The time now is 04:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com