View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default VBA Question (rookie issue)

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