+ Reply to Thread
Results 1 to 6 of 6

Clear all charts using vba

  1. #1
    Forum Contributor
    Join Date
    07-23-2019
    Location
    San Antonio, Texas
    MS-Off Ver
    Office 365
    Posts
    143

    Clear all charts using vba

    Hello,

    I am practicing and learning how to incorporate codes that will create charts in my worksheet(s). I believe I have found a working code to create the charts, but I wanted to know if anyone could provide me a code to delete or refresh the charts, so when I update the data, I can also update the charts. I have attached an example workbook. I appreciate any help that can be provided.

    Kind Regards,
    Paula M
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,526

    Re: Clear all charts using vba

    Please Login or Register  to view this content.
    Artik

  3. #3
    Forum Contributor
    Join Date
    07-23-2019
    Location
    San Antonio, Texas
    MS-Off Ver
    Office 365
    Posts
    143

    Re: Clear all charts using vba

    Hello Artik,

    I really appreciate your help and time. I added your code to the workbook, but it doesn't seem to be working and I have no clue how to determine why and/or how to correct. Could you please review the attached - with your code, and help?

    Thank you Bunches,

    Paula
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    07-23-2019
    Location
    San Antonio, Texas
    MS-Off Ver
    Office 365
    Posts
    143

    Re: Clear all charts using vba

    Still Needing some help Please.

    I have tried the code provided in the previous post, but it doesn't seem to be working to Clear the charts; it seems to Create the charts instead. Can someone please help me with a code that will delete or clear the charts?
    I really appreciate your time and help!

    Kind Regards,
    Paula
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,526

    Re: Clear all charts using vba

    The test_1 procedure consists of two loops. Loop For Each ... Next removes all the charts of the active sheet (if any). The second loop, For ... Next, inserts new charts into the worksheet.
    Since I concluded from the first post that you are primarily interested in refreshing the charts after updating the data (changing values in already existing columns or adding/removing columns with data) I decided to combine these two loops in one procedure.

    If you need two separate procedures, one for deleting charts and the other for inserting them, this set is fine:
    Please Login or Register  to view this content.
    Artik

  6. #6
    Forum Contributor
    Join Date
    07-23-2019
    Location
    San Antonio, Texas
    MS-Off Ver
    Office 365
    Posts
    143

    Re: Clear all charts using vba

    Hello Artik,

    I understand your first code now; thank you for the clarification. I will use the first code, now that I understand. Thank you soooo much for your help!

    Kind Regards,
    Paula

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Userform clear button but not to clear all entries.
    By danbates in forum Excel General
    Replies: 5
    Last Post: 08-05-2017, 02:12 PM
  2. Clear merged cell contents in comand button(clear all)
    By mohan_984 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-25-2015, 10:39 AM
  3. On Close Clear ComboBox1 - ListIndex -1 and Clear not working
    By Janc in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-07-2015, 10:10 AM
  4. Replies: 1
    Last Post: 06-21-2013, 04:05 AM
  5. [SOLVED] can someone help modify the clear command to only clear columns from A-G?
    By psunursingguy21 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-30-2013, 03:52 PM
  6. [SOLVED] Clear button, add warning dialogue box that asks: Are you sure you want to clear?
    By nenadmail in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-21-2012, 02:41 PM
  7. Button to clear sheet and automatic clear rows
    By sandbach in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-29-2010, 02:06 PM

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