Try:
cell.Value = Mid(cell, 1, iloc - 1)
Tom's code is picking up the original string from the first character to the
position of the first space character.
Alternatively:
cell.Value = left(cell, iloc - 1)
They should work the same way.
Scott Wagner wrote:
Now I am getting this error:
Wrong number of arguments or invalid property assignment (Error 450)
On line: Left is highlighted
cell.Value = Left(cell, 1, iloc - 1)
"Chip Pearson" wrote:
for each cell in Range
should be
for each cell in rng
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"Scott Wagner" wrote in
message
...
Getting the following error:
Argument not optional (Error 449)
On this line:
for each cell in Range
--
Dave Peterson