One way to fix it and count the names at the same time
Sub trimitupandcount()
mc = 0
For Each c In Range("a2:a22")
c.Value = LTrim(c)
If LCase(Left(c, 4)) = "name" Then mc = mc + 1
Next c
MsgBox mc
End Sub
If you DONT want to count the names,comment out the IF line
Sub trimitup()
For Each c In Range("a2:a22")
c.Value = LTrim(c)
Next c
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"dstiefe" <(E-Mail Removed)> wrote in message
news:FD3818E5-E7EF-400F-9F4E-(E-Mail Removed)...
>I have a column full of names...the problem is there is random spacing
>before
> the name...for example: " name" and in others it may be " name" while
> others are " name"
>
> how do I first count the number of spaces? then delete them so the name is
> at the far left?
>
> thank you