+ Reply to Thread
Results 1 to 6 of 6

clear contents of entire sheet except the contents of the table

  1. #1
    Forum Contributor
    Join Date
    04-29-2012
    Location
    nuneaton, England
    MS-Off Ver
    Office 365
    Posts
    372

    clear contents of entire sheet except the contents of the table

    how could this be achieved please

  2. #2
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: clear contents of entire sheet except the contents of the table

    Select the range of the worksheet that isn't the table and use the .clearcontents command.

    Try this: Run the macro recorder, select the range you want cleared and press DELETE. Then stop the macro recorder and look at the code it's written for you.

  3. #3
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: clear contents of entire sheet except the contents of the table

    Hi wayneg,

    There is no magic elixir function for your question. Try code like the following which worked for me:
    Please Login or Register  to view this content.
    Lewis

  4. #4
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: clear contents of entire sheet except the contents of the table

    Long, but does the trick. Just change the reference in red to reference the table you want to keep.
    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: clear contents of entire sheet except the contents of the table

    Blimey, I'm much lazier than you two. I'd just select the 4 blocks around the table and clear them, all done in 4 lines of code. eg.

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    04-29-2012
    Location
    nuneaton, England
    MS-Off Ver
    Office 365
    Posts
    372

    Re: clear contents of entire sheet except the contents of the table

    whilst away, i looked into moving the table to another sheet, clearing the contents then moving the table back. the issue i have is that the table size isnt fixed so trying to have a set range doesnt work
    Last edited by wayneg; 08-06-2015 at 08:45 AM.

+ 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] Clear contents based on contents of another cell
    By Katrina DTE in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-13-2013, 02:44 PM
  2. [SOLVED] Clear contents in another sheet
    By Oeysbrei in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-12-2012, 05:20 PM
  3. Excel 2007 : Clear contents on all protected sheet
    By SEHRA in forum Excel General
    Replies: 0
    Last Post: 06-22-2011, 08:36 AM
  4. Clear row contents and copy row contents.
    By fatalcore in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-19-2011, 01:08 PM
  5. Copy list contents down, then clear contents
    By hektisk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-07-2011, 04:34 PM
  6. Table of contents for contents of 1 sheet
    By dhbyrne in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-15-2007, 06:39 PM
  7. Clear sheet contents but retain Clipboard contents
    By nebb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2007, 01:42 PM
  8. [SOLVED] Clear contents of unprotected cells in entire workbook with a macr
    By FinnGirl in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-29-2005, 01:05 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