Matching CELL text (full word) to full word in string in anot
Thank you Tom but I get a compilation error on the following 2 lines.
f = len(trim(Cell.offset(0,-2))
l = len(trim(cell.offset(0,-1))
and I'm not quite sure how to use the script.
"Tom Ogilvy" wrote:
Sub fixData()
Dim rng as Range, cell as Range
Dim f as Long, l as Long
set rng = Range(Cells(2,3),Cells(rows.count,3))
for each cell in rng
f = len(trim(Cell.offset(0,-2))
l = len(trim(cell.offset(0,-1))
cell.Value = Trim(Right(cell,len(cell)-(f + l + 2)))
Next
End Sub
Test it on a copy of your data
--
Regards,
Tom Ogilvy
"DShaw" wrote in message
...
I am not the greatest at programig this is what I have.
I recieved a data files with COLUMB A [ FISRT NAME] COLUMB B [LAST NAME]
now columb c is suppose to have just the address but it has the first and
last name in it as well. See below.
example:
COLUMB A | COLUMB B COLUMBC
-----------------------------------------------------------------------------------
John |Smith | John Smith 123 loveless drive Cville ST
12345
I would like to use COLUMB B "last name" find the string in COLUMB C and
trim from the charector count it finds from the end of the last name to
the
begining of the cell. Can anyone help.
Thank you in advance.
Dan
|