|First, a posting tip...|
Please click on the blue line at the end of this post and read the instructions on how to post example data and VBA code in this forum.
Second, without any example data, we can't tell you why your code is not giving you the results you want. We have nothing to test it against. We don't need a lot of data, just enough to show us what you are starting with and the desired output based on that data.
All I can say at this point is that I don't see anything in the code that compares Column A to Column B. The only "comparison" instruction I see is this one:
If Cells(rw + 1, 2) <> Cells(rw, 2) Then
That line compares a cell in Column B to the cell above it. That doesn't sound like what you are trying to do, but again, without some example data, I don't really know what you are trying to do.
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.