Results 1 to 2 of 2

Delete row if some columns equal others

Threaded View

  1. #1
    Registered User
    Join Date
    07-23-2013
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    4

    Delete row if some columns equal others

    How should I make a code that deletes rows if:
    Some value in column B has its symmetric in column B as well AND Column E coincides for both. If TRUE, I want to delete the row with the positive value.

    Hope someone can give me a help!

    Thanks in advance

    I did something like the following but I don't know how to make it ANY row instead of +1 neither how to make it delete the positive B column value row.

    Sub anulaçoes()
    Dim LastRow As Long
    LastRow = [A4725].End(xlUp).Row
    For i = LastRow To 1 Step -1
    If Cells(i, 2) = -Cells(i + 1, 2) And Cells(i, 5) <> Cells(i + 1, 5) Then Rows(i & ":" & i).EntireRow.Delete
    Next i
    End Sub
    Last edited by arlu1201; 07-23-2013 at 06:44 AM. Reason: Use code tags in future.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help!! How to delete rows based on value on 2 columns(same equal=0)
    By giallorossi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2013, 03:19 AM
  2. [SOLVED] Delete row if total is equal to 0.00%
    By csch123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-04-2013, 12:50 PM
  3. Replies: 2
    Last Post: 01-14-2009, 04:01 AM
  4. delete cells until value in equal
    By stevekirk in forum Excel General
    Replies: 8
    Last Post: 12-17-2006, 03:37 PM
  5. [SOLVED] Comparing data in columns and delete if not equal
    By Robert in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-04-2005, 04:06 PM

Tags for this Thread

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