View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
drjohnwilliams drjohnwilliams is offline
external usenet poster
 
Posts: 1
Default Compare first characters in two cells

I have a spreadsheet of surnames in alphabetical order. As these were
OCR'd some of the entries got split into two cells e.g. This would be a
typical list:

Adams John Jones
Robert
Adams Michael
Adams Albert.

The split is random so one can't select every nth cell

As this is over 35K rows long. I am trying to move those split names
such as Robert to an adjacent cell to the right of the correct name. So
after processing it would look like:
Adams John Jones Robert
Adams Michael.

I thought the best way to do this would be to start at the top of the
column, read the first character in the cell e.g. A, (Adams John Jones)
go down a line and read the next first character R (Robert)and compare.
If the two characters are the same then I would compare the second one
R (Robert) with the next one down; A (Adams Michael). If they were
different then I would move the second entry Robert up and across one
row. Go back to the column and down a row to avoid the now blank cell
and compare two cells again until the end is reached.

I am having real problems in figusring out how to select just the first
character in a cell and then compare it with another.
Thanks

john


---
Message posted from http://www.ExcelForum.com/