+ Reply to Thread
Results 1 to 4 of 4

How to delete the regression generated chart in vba?

  1. #1
    Registered User
    Join Date
    09-03-2010
    Location
    new york
    MS-Off Ver
    Excel 2003
    Posts
    2

    How to delete the regression generated chart in vba?

    Hi,

    I'm now developing a spreadsheet that load data from outside automatically every day and generate regression report for the data. I'm now using function like

    Call regress(ActiveSheet.Range("$N$2:$N$2298"), ActiveSheet.Range("$O$2:$O$2298"),False, True, , ActiveSheet.Range("$A$1"), False, False, False, True, , False)

    to generate the regression report. Although it will overwrite the data area, the old chart would be still there.

    Is there anyway I can avoid generate chart and update it automatically or delete it and generate a new one?

    The main problem is the chart ID seems like to be random and I have more than one chart in the sheet.

    Thanks!

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441

    Re: How to delete the regression generated chart in vba?

    You would need code to remove existing charts. Some how you need to be able to distingish between those chart you want to keep and those that can be delete.
    This could be their name or position or chart type.

    Once the regression has run and produced charts you could use code to give those a unique name, which next time you can test for and delete.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    09-03-2010
    Location
    new york
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: How to delete the regression generated chart in vba?

    Quote Originally Posted by Andy Pope View Post
    You would need code to remove existing charts. Some how you need to be able to distingish between those chart you want to keep and those that can be delete.
    This could be their name or position or chart type.

    Once the regression has run and produced charts you could use code to give those a unique name, which next time you can test for and delete.
    Thanks for the help. Could you provide the example to give chart unique name after regression has run?

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441

    Re: How to delete the regression generated chart in vba?

    Untested

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1