Thread: Leading Zeros
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Leading Zeros

Try this UDF:

Function nozero(r As Range) As String
v = r.Value
n = Len(v)
For i = 1 To n
If Left(v, 1) = "0" Then
v = Right(v, Len(v) - 1)
Else
Exit For
End If
Next
nozero = v
End Function
--
Gary''s Student - gsnu200747


"Ben Watts" wrote:

I have a column that has leading zeros. I want to get rid of all leading
zeros. Some have 3, some have 2...etc....SOme of the cells have letters in
them also. SO what can I do? Thanks