Originally Posted by
TMShucks
If you are deleting rows, you need to work from the bottom up otherwise the loop will get "out of sync".
Not sure of your logic so I can't really help with what it should actually be.
Regards, TMS
I am not having any trouble with the "sync" of the loop. I am not sure what you mean by logic, and because I am new with writing VBA I will try to be more specific.
I am trying to delete duplicate lines of data by comparing a cell in col A to the adjacent col B cell. ie A2 to B2, A3 to B3... If the values of the two match, then I want to delete that line.
Here is that code that WORKS just fine for that...
However, this code deletes the row when both values are blank. (Obviously because they are both blank, the are both equal values)
I do not want them to be deleted when they are blank because I have data in other adjacent columns that may associate with those blank cells.
So I am trying to figure out a way to keep from deleting those rows that have blanks in both col A and B.
I need to add something to the code that says "If the active cell is blank, then end the if statement and go to the next row."
Hope this adds some clarification...
Bookmarks