alu
09-12-2007, 01:50 AM
Morning people,
I have this code which when I select an enitre sheet will clear white space after text in column A; e.g "Yorrick " becomes "Yorrick".
What I am trying to do is set it so it will clear white space off each column of each sheet of the work book.
Have tried doing with the macro recorder but I am going round in circles :dunno
Sub trimWhiteSpace()
Dim i As Long
For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row
Cells(i, "A").Value = Trim$(Cells(i, "A").Value)
Next i
End Sub
Thanks a lot in advance!!
I have this code which when I select an enitre sheet will clear white space after text in column A; e.g "Yorrick " becomes "Yorrick".
What I am trying to do is set it so it will clear white space off each column of each sheet of the work book.
Have tried doing with the macro recorder but I am going round in circles :dunno
Sub trimWhiteSpace()
Dim i As Long
For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row
Cells(i, "A").Value = Trim$(Cells(i, "A").Value)
Next i
End Sub
Thanks a lot in advance!!