+ Reply to Thread
Results 1 to 6 of 6

Clear Cells in Range Based on Column

  1. #1
    Registered User
    Join Date
    10-26-2016
    Location
    NY
    MS-Off Ver
    MS Office 2016
    Posts
    25

    Clear Cells in Range Based on Column

    I've been using the formula below to clear a specific range depending on the criteria in another cell.

    Please Login or Register  to view this content.
    The problem I'm having is I want to extend the entire formula for if range B2:B19 is changed, clear the correlating row's range based on the case criteria, without creating an independent statement for each row. I'm a bit of a notice and think there may be a simple solution to this.
    Last edited by Oxygen Potassium; 08-21-2017 at 09:10 PM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Clear Cells in Range Based on Column

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    10-26-2016
    Location
    NY
    MS-Off Ver
    MS Office 2016
    Posts
    25

    Re: Clear Cells in Range Based on Column

    I apologize for the etiquette. Thank you for pointing this out.

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Clear Cells in Range Based on Column

    How does this work for you ?

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Registered User
    Join Date
    10-26-2016
    Location
    NY
    MS-Off Ver
    MS Office 2016
    Posts
    25

    Re: Clear Cells in Range Based on Column

    Thank you bakerman2. I like that method but just found another using a variable instead of target.offset. This seems to solve my problem.

    Please Login or Register  to view this content.

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Clear Cells in Range Based on Column

    Why would you wanna loop 17 cells every time you only change 1 ?????

+ 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. Sum multiple cells in one column based on date range in another column
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-24-2017, 09:19 AM
  2. Replies: 3
    Last Post: 04-18-2016, 12:16 AM
  3. VBA to clear cells in one column based on another
    By gibsomaa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-22-2014, 03:20 PM
  4. Clear Contents of column based on data in another column
    By wachao in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-10-2014, 02:39 AM
  5. Clear range based on cell value - clearing cells out of specified range
    By CADiphile in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-15-2013, 02:48 PM
  6. Replies: 1
    Last Post: 06-21-2013, 04:05 AM
  7. [SOLVED] Macro needed to clear cells in range based on value of cells in another range
    By msmith7113 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-05-2013, 12:32 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