Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: cell contents as strings

  1. #1
    Guest

    Default

    Mr. Excel,

    I am creating multiple charts in a macro using a for loop, thanks to your help yesterday. How can I let the title be equal to the value of a cell (or range of cells)? Basically, I need to set the value of ActiveChart.ChartTitle.Characters.Text to the appropriate cell value (being looped through). Also, after creating the chart, I export it, but when I try to delete it after the export (ActiveChart.Delete) it fails. What's the solution? Thanks,

    JAS

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    For the first one:

    ActiveChart.HasTitle = True
    ActiveChart.ChartTitle.Text = Range("A1")

    for the second one, try with:

    ActiveSheet.ChartObjects(1).Delete

    or

    ActiveSheet.ChartObjects(ActiveSheet.ChartObjects.Count).Delete


    Regards,

    Juan Pablo González
    http://www.juanpg.com

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •