+ Reply to Thread
Results 1 to 6 of 6

Macro to Delete Row IF

  1. #1
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Macro to Delete Row IF

    Hi everyone,
    Any suggestions on how to delete rows by VBA?
    The condition is, If the value on Cell (From D7 to last record) is equal to "#VALUE!"
    It will delete the entire row.
    Appreciate your help once more. Thank you in advance.

    Andrew
    Last edited by Andrew.Trevayne; 10-13-2011 at 11:07 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: Macro to Delete Row IF

    when you insert or delete rows start from last row to first row.

    as you are tampering with your data sheet better copy sheet1 to sheet 2 as precaution

    try this macro

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro to Delete Row IF

    Venkat,

    I do not see the #value condition in the code. The rows have to be deleted based on that condition.

  4. #4
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Re: Macro to Delete Row IF

    Hi Venkat,
    Tried the Script but it doesn't do anything on my spreadsheet. Please advise.
    Thank you.

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro to Delete Row IF

    Hi Andrew.Trevayne

    Slight modification of venkat1926 code...see if this works
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  6. #6
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Re: Macro to Delete Row IF

    Jaslake & Venkat,
    Thanks to you both. ^^

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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