Compare columns - weird baffling problem

C

ChipButtyMan

Hi,
I have tried three different codes & get the same strange problem.
I have two columns A & B.
My code/s compare the serial numbers in column A with column B and
returns;
what numbers column A has that column B hasn't to 'result column' D
what numbers column B has that column A hasn't to 'result column' E

This works fine when I type the serial numbers into A & B myself by
hand, however,
when I import the list of numbers into column A (copy & paste from
someone elses file)
it returns incorrect results ie. it returns serial numbers that exist
in both columns to both results columns!
That is strange enough in itself but it gets stranger;
I can rectify the problem simply by retyping the serial number in each
cell in column A?
For example, if after running the code B1P04599 wrongly appears in all
four columns, I simply type over B1P04599 in column A, run the code
again & B1P04599 no longer appears in columns D & E?
Anyone got any ideas what is causing this strange behaviour?

Thanks for your help.
 
J

Joel

there are probably extra spaces or you are comparing data where the
Capitalization is different in the two columns. Click on one of the cells
you are having problems with then go to the F(x) box at top of worksheet.
Click in F(x) box. Then use the arrows (left and right) to move cursor
across box and see if there are blank characters at the beginning or end of
the string. Try for both column A and Column B data.
 
N

Nigel

Without seeing the code it is difficult to predict.

But I suspect that you have some spaces or other non-visible characters in
the imported data. Try adding some trim functions to the comparison process
in your code.

Post your code if the problem persists.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top