+ Reply to Thread
Results 1 to 2 of 2

Macro to delete certain rows if DATE criteria is met

  1. #1
    Registered User
    Join Date
    06-21-2013
    Location
    Wro
    MS-Off Ver
    Excel 2007
    Posts
    18

    Macro to delete certain rows if DATE criteria is met

    Hi Guys.

    To describe the problem quickly: I have a worksheet with a huge amount of data. What I need from the macro is to:

    1. Delete each row if the cell in this row does not contain specific text (lets say, it is column B, its named "Surname" and the text is "Smith" or the text is "Black"). If the surname is not Smith (or Black), let's delete the whole row and proceed with the next one.

    2. When we complete the 1st step, now it is time to check the date. We have column C, named "Date" and of course each of the cell in this column is either blank or contains a date. What I need is to delete each row if the cell (date) in this row is earlier than my date. The thing is, I would like to have a popup window to set up the criteria date each time I run the macro. For example: I put 2014-02-20 in the popup window, and all the rows, where the date in column C is earlier than 20th of Feb 2014 are deleted. Is it possible?

    That is more less what I dream about to have. Any help will be highly appreciated.

    Thx in advance.

    PS.

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

    Re: Macro to delete certain rows if DATE criteria is met

    It would be easier to help if you could post a copy of your file.
    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.

+ 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. Macro to delete rows not containing multiple criteria
    By jerrydiaz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2013, 09:06 AM
  2. Delete Rows based on Two Criteria (Word(s) String and Date)
    By PaulLor89 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-05-2013, 07:49 PM
  3. [SOLVED] Macro or Function to delete rows if both criteria are not met
    By nrsChristine in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-12-2012, 07:11 PM
  4. Macro, autofilter, delete rows outside date range, defined names as criteria
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-30-2011, 04:10 AM
  5. Delete rows based on multiple criteria (Date & Text)
    By Poulan in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 10-08-2010, 09:00 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