VBA to delete leading space
Is this a one time fix or something to be done repeatedly?
One time:
place formula in cell and fill down.
=RIGHT(A1, LEN(A1)-1)
If this is going in a macro then it will work quite similar.
Public Sub remove_space()
Dim c As Range ' Cell
For Each c In ActiveSheet.Range("A:A")
If Len(c) 0 Then
c = Mid(c, 2)
End If
Next c
End Sub
Cheers,
Jason Lepack
On Jan 17, 10:54 am, CB wrote:
I have a column of data that has a leading blank in each cell. Does someone
have a code example that I can use to delete this leading space? I have
spaces between data in these cells and just need to delete the leading space
on the left hand side of each cell. Any and all replies are greatly
appreciated.
|