+ Reply to Thread
Results 1 to 17 of 17

Need help with formula deleting rows

  1. #1
    Registered User
    Join Date
    09-19-2013
    Location
    VA, USA
    MS-Off Ver
    Excel 2007
    Posts
    28

    Need help with formula deleting rows

    Hello all,

    I'm recording a macro and I have this task that I don't know how to tackle. The number of rows of data are different each week.

    Main tab data:

    Column A to L
    Column F (Date Received) has date data and there are cells that are (blanks).

    I want to look for all rows of data with Date Received prior to 2/1/2011 or (blanks), and delete them.


    Please help. Your help is greatly appreciated.
    Last edited by siumui00; 10-08-2013 at 04:24 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Need help with formula deleting rows

    Hi..

    Attach a sample workbook... the requirements are not that difficult (coding wise) .. but re creating others spreadsheets gets tiresome..

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need help with formula deleting rows

    Maybe:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-19-2013
    Location
    VA, USA
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Need help with formula deleting rows

    Hello all,

    Thank you all for your help. I poke around and the codes below work. Although I'm still working on the syntax for checking for blank or IsEmpty() to delete rows that are blank and I can't get it to work yet. The codes work successfully deleting all rows that have Date Received prior to 2/1/2011.

    Please Login or Register  to view this content.
    Last edited by siumui00; 10-10-2013 at 10:06 AM.

  5. #5
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Need help with formula deleting rows

    Hi..

    Maybe this..

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    09-19-2013
    Location
    VA, USA
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Need help with formula deleting rows

    Hello alansidman,

    I apologize. I have modified my post to use code tags already. Thank you.

    I see that apo's message has been deleted. Can you restore apo's message?
    Last edited by siumui00; 10-10-2013 at 10:35 AM.

  7. #7
    Registered User
    Join Date
    09-19-2013
    Location
    VA, USA
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Need help with formula deleting rows

    Quote Originally Posted by apo View Post
    Hi..

    Maybe this..

    Please Login or Register  to view this content.

    Hello apo,

    I did try that but it didn't work.

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need help with formula deleting rows

    Try it with two ifs:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    09-19-2013
    Location
    VA, USA
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Need help with formula deleting rows

    Thank you JOHN H. DAVIS,

    I tried and it didn't work.

    I tried the 2 codes below and neither work.


    Please Login or Register  to view this content.


    Please Login or Register  to view this content.

  10. #10
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need help with formula deleting rows

    Can you attach a sample, so we can see why the code doesn't work? To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.

  11. #11
    Registered User
    Join Date
    09-19-2013
    Location
    VA, USA
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Need help with formula deleting rows

    Quote Originally Posted by JOHN H. DAVIS View Post
    Can you attach a sample, so we can see why the code doesn't work? To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.

    Hello John,

    I'm trying to attach the file but I don't see the paperclip icon. I saw it a moment ago and when I clicked on it to attach file, i had to log in again then it said I don't have permission.....

  12. #12
    Registered User
    Join Date
    09-19-2013
    Location
    VA, USA
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Need help with formula deleting rows

    Quote Originally Posted by JOHN H. DAVIS View Post
    Can you attach a sample, so we can see why the code doesn't work? To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.

    Please see attachment.

    I finally got it to work.
    Attached Files Attached Files

  13. #13
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need help with formula deleting rows

    This works on the sample you provided. BTW your cells which appeared to be empty had spaces in them.

    Please Login or Register  to view this content.

  14. #14
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need help with formula deleting rows

    Filter code as an option, but dates behave funny in excel and still do not understand how they work.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    09-19-2013
    Location
    VA, USA
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Need help with formula deleting rows

    Quote Originally Posted by JOHN H. DAVIS View Post
    This works on the sample you provided. BTW your cells which appeared to be empty had spaces in them.

    Please Login or Register  to view this content.

    Thank you so much John. It works!!!! Although I have no idea why column H has spaces. I got the data from a daily e-mail. Thank you!!!

  16. #16
    Registered User
    Join Date
    09-19-2013
    Location
    VA, USA
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Need help with formula deleting rows

    Quote Originally Posted by AB33 View Post
    Filter code as an option, but dates behave funny in excel and still do not understand how they work.
    Hello AB33,

    Thank you for helping me. I looked at the codes and still trying to understand part of the codes for I'm new to vba codes.


    ---------

    Thank you all. Have a great evening!

  17. #17
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need help with formula deleting rows

    Infact, you do not a code for this task. You could have recorded a filter function in excel and you are home and dry. A filter code is not much difference to the one you get from Excel's filter function.

+ 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. Formula error after deleting rows
    By dougmcc1 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-12-2013, 11:32 AM
  2. [SOLVED] Deleting Rows & Formula Values (#REF!)
    By thalantyrdsl in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-14-2013, 07:09 AM
  3. Deleting rows causes formula to change
    By jgupte in forum Excel General
    Replies: 4
    Last Post: 08-20-2012, 08:39 PM
  4. deleting rows based on a formula
    By kaitewright in forum Excel General
    Replies: 4
    Last Post: 09-05-2006, 06:03 PM
  5. Deleting multiple rows through a formula
    By mike_vr in forum Excel General
    Replies: 2
    Last Post: 03-15-2005, 10:06 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