+ Reply to Thread
Results 1 to 4 of 4

Need help on how to exclude a row previously commanded to be removed

  1. #1
    Registered User
    Join Date
    01-31-2016
    Location
    tampa, florida
    MS-Off Ver
    2013
    Posts
    2

    Need help on how to exclude a row previously commanded to be removed

    I currently have created a Macro to eliminate a row if column "C" and "I" within that row are both blank. Unfortunately I need an exception to that should there be a key word found in column "J" (there are actually 3 different words to look for). Is there a way to do this?
    Last edited by alycat57; 02-02-2016 at 12:16 PM.

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Need help on how to exclude a row previously commanded to be removed

    Not sure how your looping through rows, so just as an example:

    Please Login or Register  to view this content.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  3. #3
    Registered User
    Join Date
    01-31-2016
    Location
    tampa, florida
    MS-Off Ver
    2013
    Posts
    2

    Re: Need help on how to exclude a row previously commanded to be removed

    Thank you for your response, I should have included the macro code, including it now:

    Dim lr As Long, r As Long
    lr = Cells(Rows.Count, "C").End(xlUp).Row
    For r = lr To 1 Step -1
    If Range("C" & r).Value = "" And Range("I" & r).Value = "" Then Rows(r).Delete
    If Range("J" & r).Value = "" Then Rows(r).Delete
    Next r
    End Sub

    I attempted your code as well as trying to put the first row of it into mine, same result.

  4. #4
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Need help on how to exclude a row previously commanded to be removed

    In the future, please put your code in CODE tags, the # sign in the text editor tool bar.

    Please Login or Register  to view this content.

+ 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. Add EXCLUDE Option in table to Exclude from Solver
    By lbofbb in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-17-2015, 09:05 AM
  2. Button Click on Spreadsheet commanded by Button Click on Userform
    By Quilie19 in forum Excel Programming / VBA / Macros
    Replies: 33
    Last Post: 04-07-2015, 11:35 PM
  3. Min max removed
    By ajj1971 in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 02-16-2014, 07:16 PM
  4. If Contains To Be Removed
    By marko737 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-02-2014, 06:27 PM
  5. (Removed)
    By rkoenig in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-09-2011, 01:44 AM
  6. removed
    By billykiller05 in forum Excel General
    Replies: 1
    Last Post: 05-12-2009, 02:32 PM
  7. UserForm1 not getting removed using VBA
    By Alok in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-03-2006, 10:25 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