+ Reply to Thread
Results 1 to 4 of 4

Clear existing data before running another macro?

  1. #1
    Registered User
    Join Date
    06-26-2014
    Location
    New York, NY
    MS-Off Ver
    Office 2013
    Posts
    10

    Clear existing data before running another macro?

    Hi, I am new to VBA, I currently have a drop down list and when you select a value, the macro that corresponds to that value runs. The point of this is to display a different chart when you select a value. However, when you select a new value, the previous macro that ran doesn't disappear so the charts overlap which is pointless. How can I tell excel that it needs to clear the previous chart/macro before displaying the next? Any help would be appreciated! To be clear all I did for my macro was copy an existing chart and paste it into another sheet. Maybe there is a better way than that? Here is my code:

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Clear existing data before running another macro?

    set the datasource to be an empty string.
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    06-26-2014
    Location
    New York, NY
    MS-Off Ver
    Office 2013
    Posts
    10

    Re: Clear existing data before running another macro?

    Quote Originally Posted by nathansav View Post
    set the datasource to be an empty string.
    How exactly would I do that :s, I know nothing about programming.

  4. #4
    Registered User
    Join Date
    06-26-2014
    Location
    New York, NY
    MS-Off Ver
    Office 2013
    Posts
    10

    Re: Clear existing data before running another macro?

    Really need help!

+ 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. Replies: 3
    Last Post: 10-14-2013, 03:06 PM
  2. Replies: 1
    Last Post: 06-21-2013, 04:05 AM
  3. How to clear memory while running a macro
    By Hjahren in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-15-2010, 10:04 AM
  4. [SOLVED] Creating a graph with existing data...clear data after save
    By Cam Neeson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-15-2006, 01:40 PM
  5. Running a macro to edit one line in existing VBA
    By jbeard@barrick.com.au in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2006, 03:50 AM

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