compareing 2 columns

  • Thread starter Thread starter tomi12619
  • Start date Start date
T

tomi12619

Hi
I would like to compare 2 columns values. the "+1" is still value. For example there are 1406 in column A and 14061 in column B in this case the whole row should be deleted from the workbook.

Is there a way to do it with a macro?
 
You could enter a formula like this in C1:

=IF(A1=B1,"ok","delete")

and then copy down for as many values as you have. Then use Data |
Filter | Autofilter, and on the drop-down in column C select "delete".
Highlight all the visible rows and click on Edit | Delete Row. Remove
the filters and delete column C.

Hope this helps.

Pete
 
I does not work properly. In column B I have the +1 values such as

1406 14061
1407 14071

but sometimes wrong things like

1408 1408
1408 .C
 
A B C
1406 14061 OK
1407 14071 OK
1407 587 Wrong!!
1426 . Wrong!!
1426 1426 Wrong!!


the first row 1406=1406+1 is correct logically. Other values, strings
are bad. I would like to delete the OK things.

Column C: well, I would like to do this...
 
You could try something like this in C1:

=IF(A1&"1"=B1,"OK","Wrong!!")

then copy down and apply the filter to choose OK, then Edit | Delete
Row.

Hope this helps.

Pete
 
Thank you Pete.
Well, it is still not works but maybe somehow I gonna try it in this way.
 
Ah well, maybe you have spaces at the end of 1406 or 14061 - if so use
TRIM to get rid of them.

Pete
 
Back
Top