Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how do i compare 2 cells and extract the text that is different?
I have 2 columns that contain text that is different, but almost matches
except for 1 character that does not. i want to find out what is the character in the cell that does NOT match. ie. column a = APTK745 (i want to return the P) column b = ARTK745 (i want to return the R) or column a = ANPF841 (i want to return the F) column b = ANPE841 (i want to return the E) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how do i compare 2 cells and extract the text that is different?
I have a solution if the changed characters are in the same place or you are
looking for the first character that is changed in a cell. Function FindDif (strFirst as string, strSecond as string) as string Dim iLoopChar as integer, bFoundDif as boolean For iLoopChar = 1 to len(strFirst) If mid (strFirst,iloopchar,1) < mid (strSecond,iloopchar,1) then bFoundDif = true Exit for End if Next iLoopChar If bFoundDif then FindDif = mid (strFirst,iloopchar,1) Else FindDif = €œN/A€ End if exit Funciton Good luck -- Stewart Rogers DataSort Software, L.C. "ky1234" wrote: I have 2 columns that contain text that is different, but almost matches except for 1 character that does not. i want to find out what is the character in the cell that does NOT match. ie. column a = APTK745 (i want to return the P) column b = ARTK745 (i want to return the R) or column a = ANPF841 (i want to return the F) column b = ANPE841 (i want to return the E) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Extract emails from cells with text | Excel Worksheet Functions | |||
Extract text on right of various length from cells | Excel Discussion (Misc queries) | |||
How to extract just text from cells | Excel Worksheet Functions | |||
Find / Compare Text in 2 different cells | Excel Discussion (Misc queries) | |||
How do you compare text in cells | Excel Worksheet Functions |