Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract emails from cells with text AJexcelQuestions Excel Worksheet Functions 3 February 4th 10 03:47 AM
Extract text on right of various length from cells HammerD Excel Discussion (Misc queries) 10 July 2nd 09 11:01 AM
How to extract just text from cells Access Joe Excel Worksheet Functions 4 April 29th 08 09:06 PM
Find / Compare Text in 2 different cells nastech Excel Discussion (Misc queries) 2 October 30th 07 01:29 PM
How do you compare text in cells Sam Excel Worksheet Functions 1 February 18th 05 05:16 PM


All times are GMT +1. The time now is 06:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"