chartobject

  • Thread starter Thread starter alldreams
  • Start date Start date
A

alldreams

I have this macro that activates chartobject("Chart 1")
However, I like the macro to select whatever chart on the
woooksheet, not just chart 1. How can I do that?

Sub test()
Sheets("CHARTS").Select

ActiveSheet.ChartObjects("chart 583").Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy
Workbooks.Add
ActiveSheet.Paste
'need to figure out how to email this workbook
ActiveWindow.Close

End Sub
 
Sub test()
Sheets("CHARTS").Select

ActiveSheet.ChartObjects("chart 583").Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy
Workbooks.Add
ActiveSheet.Paste
Activeworkbook.SendMail Recipients:="(e-mail address removed)", Subject:="Hi"
'need to figure out how to email this workbook
ActiveWindow.Close

End Sub

You have to have some way to communicate which chart you want to copy.
 
I just want to grab the only Chartobject there is on the
worksheet. the chartobject number is never the same since
it is updated depending on selection from a drop down menu.

Any suggestions?
 
Sub test()
Sheets("CHARTS").Select

ActiveSheet.ChartObjects(1).Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy
Workbooks.Add
ActiveSheet.Paste
Activeworkbook.SendMail Recipients:="(e-mail address removed)", Subject:="Hi"
'need to figure out how to email this workbook
ActiveWindow.Close

End Sub


if there is only one, its numerical index will be 1
 

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

Back
Top