+ Reply to Thread
Results 1 to 8 of 8

Clear Cell Containing Done And The Proceeding Cell

  1. #1
    Forum Contributor
    Join Date
    12-22-2004
    Location
    Kokomo, Indiana
    Posts
    236

    Question Clear Cell Containing Done And The Proceeding Cell

    I get spreadsheets with lots of data which is not relevant to me. The unwanted data typically has a text name in one cell for example in cell A1 and in B1 will have the word Done. This pair, random text and Done appears throughout my spreadsheet. In those cells which have the word Done, how can I clear the contents of both the preceeding cell and the cell with the word Done in it. A typical spreadsheet can have 1000's of instances of Done and a preceeding cell which have no use to me. I would like to do this in VBA 2016. Your assistance would greatly help a saturated engineer. Thanks.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Clear Cell Containing Done And The Proceeding Cell

    So if B11 had Done in it, you want to clear A10, B10, A11, B11; is that correct? And do that for all cells in column B that have Done?
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    12-22-2004
    Location
    Kokomo, Indiana
    Posts
    236

    Question Re: Clear Cell Containing Done And The Proceeding Cell

    Oops, I see the error in my request. Sorry. If B11 had Done, then clear contents of A11 and B11. Starting at row 11, there could be a dozen instances of Done in one cell and in each case the preceeding cell and the cell with Done need to be cleared. So for example if B11, E11, AB11, AF11 had Done then clear A11, B11 and D11, E11 and AA11, AB11 and AE11, AF11. There could be thousands of rows. Please excuse my gaffe.
    Last edited by ajocius; 12-22-2017 at 09:26 AM.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Clear Cell Containing Done And The Proceeding Cell

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-22-2004
    Location
    Kokomo, Indiana
    Posts
    236

    Re: Clear Cell Containing Done And The Proceeding Cell

    Would I substitute B:B for B:DDD to get a large swath of columns?

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Clear Cell Containing Done And The Proceeding Cell

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-22-2004
    Location
    Kokomo, Indiana
    Posts
    236

    Re: Clear Cell Containing Done And The Proceeding Cell

    It works great. Thank you and Merry Christmas.

  8. #8
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Clear Cell Containing Done And The Proceeding Cell

    You're welcome and thanks for the feedback. Happy holidays.

+ 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. VBA to Clear 1 Cell and Clear other cells Formula only
    By oneblondebrow in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-17-2017, 12:56 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. VBA to clear contents of the cell in a column of data in a cell starts with specific word.
    By winmaxservices1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2015, 08:25 AM
  4. Replies: 3
    Last Post: 08-16-2014, 09:55 AM
  5. [SOLVED] move down column and for every blank cell, clear contents of cell to the left
    By hopefulhart in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-01-2014, 11:23 AM
  6. Replies: 1
    Last Post: 06-21-2013, 04:05 AM
  7. Macro that will clear contents of cell based on format of text in adjacent cell
    By judasdac in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-12-2012, 01:56 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