+ Reply to Thread
Results 1 to 4 of 4

Clearing Sheet Content

  1. #1
    Registered User
    Join Date
    12-11-2013
    Location
    Emeryville, USA
    MS-Off Ver
    Excel 2010
    Posts
    23

    Clearing Sheet Content

    Hi,

    I have a macro that populates a sheet with data to be charted. I need that data to clear so when another request is made, the new data the macro populates the sheet with wont be interfered with by the previous data. Ive found this:

    Thisworkbook.Worksheets("Sheet2").Cells.ClearContents

    The problem is when I place that line of code at the end of my macro, it clears evertying to early and makes my chart come out blank. Must I create a conditionality so that it knows to clear the content after its been populated, but before it's populated again, or is there somewhere I can place it in my overall code that will do the trick? Any suggestions or help would be appreciated.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Clearing Sheet Content

    Try placing it at the beginning of the macro so it starts by clearing the sheet and then populates it.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    12-11-2013
    Location
    Emeryville, USA
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Clearing Sheet Content

    Thanks. That actually worked perfect.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Clearing Sheet Content

    My pleasure.

+ 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. Auto Clearing Content
    By sgris in forum Excel General
    Replies: 1
    Last Post: 12-05-2012, 01:31 AM
  2. clearing content from blank cells
    By cotw in forum Excel General
    Replies: 6
    Last Post: 08-11-2012, 01:44 PM
  3. [SOLVED] Exclude column when clearing content with VBA
    By newrui in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-10-2012, 11:37 AM
  4. clearing cell content on MAC?
    By themachine in forum Excel General
    Replies: 4
    Last Post: 07-22-2010, 08:39 AM
  5. [SOLVED] clearing cell content in a macro
    By dziw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-25-2007, 12:02 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