+ Reply to Thread
Results 1 to 7 of 7

Clear Contents of a range of cells

  1. #1
    Registered User
    Join Date
    01-29-2007
    Posts
    69

    Clear Contents of a range of cells

    Good Afternoon,
    I am attempting to create a macro to clear contents of a range of cells on multiple columns.
    My example would be
    Clear contents of F8:F59, K8:K59 and so on. I will assign this to a button on top of each worksheet to clear multiple column ranges more than the example above. If i can get a start i can add the rest of the range of cells.

    Thank you.

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

    Re: Clear Contents of a range of cells

    Try:
    Please Login or Register  to view this content.
    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
    01-29-2007
    Posts
    69

    Re: Clear Contents of a range of cells

    I tried that exact code earlier and got a dialog box with 400 in it. Am i missing something?

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

    Re: Clear Contents of a range of cells

    Was that an error message that you got? if so, could you attach a copy of your file? Include a detailed explanation of what you would like to do referring to specific cells and worksheets. If the workbook contains confidential information, you could replace it with generic data.

  5. #5
    Registered User
    Join Date
    01-29-2007
    Posts
    69

    Re: Clear Contents of a range of cells

    It was a dialog box that has a red x on the left side with "400" beside it. No other message to indicate a message. I will have to create a sheet that doesnt have some of the confidential data in it.
    Its basically a pricing template that i use and copy as a new workbook. The columns in question are for quantity of materials. I only want those cleared but continue to use the rest of the data. Again, I can upload a sample shortly.

  6. #6
    Valued Forum Contributor Maudibe's Avatar
    Join Date
    12-21-2016
    Location
    USA
    MS-Off Ver
    2010-2013
    Posts
    326

    Re: Clear Contents of a range of cells

    Add the following lines to the code and report back the description

    Please Login or Register  to view this content.

  7. #7
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Clear Contents of a range of cells

    Try this, with some of the quote marks removed
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

+ 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] VBA if any value in a range changes, clear contents of other cells.
    By devi1337 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-29-2017, 02:07 PM
  2. [SOLVED] Clear the contents of Unprotected cells - EXCEPT a certain range
    By ronkeakano in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-13-2015, 01:40 PM
  3. Clear Contents of Dependent DropDowns in a range but keep formulas for those cells
    By jeffclanders in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-22-2015, 10:51 AM
  4. [SOLVED] Macro to Clear contents in a range of cells when Date change.
    By aneshdas in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-08-2014, 01:53 AM
  5. Replies: 6
    Last Post: 06-05-2013, 12:14 AM
  6. Replies: 18
    Last Post: 02-10-2013, 05:32 PM
  7. Clear contents of cells in a range, LEN=0
    By jenny_journalist in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-29-2009, 11:37 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