View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
PCLIVE PCLIVE is offline
external usenet poster
 
Posts: 1,311
Default Remove Leading Comma

You needed to use Right instead of left.

For Each cell In Range("I3:I10")
If Left(cell.Value, 1) = "," Then
cell.Value = Right(cell, Len(cell.Value) - 1)

End If
Next


"Katie" wrote in message
...
Hello all- I know that we spoke before about removing a trailing comma, so
i
tried to amend that code to remove a leading comma from a range, but it's
not
working in cells where there's anything after the comma. Could anyone
point
out what I did wrong with this code?

Range("I3:I10").Select
For Each cell In Selection
If Left(cell.Value, 1) = "," Then
cell.Value = Left(cell.Value, Len(cell.Value) - 1)
End If
Next