hi,
I'm using CleanTrim function wrote by Rick: Trim all Cells in a Worksheet - VBA
but I got Run-time error `1004`
Application-defined or object-defined error
after 1774 recrods
my code below
do you know what is wrong?
I'm using CleanTrim function wrote by Rick: Trim all Cells in a Worksheet - VBA
but I got Run-time error `1004`
Application-defined or object-defined error
after 1774 recrods
my code below
Rich (BB code):
Rich (BB code):
Dim sourceWb As WorkbookDim LastRow, x_rows As Long
Dim i As Long
Set sourceWb = ActiveWorkbook
Set WS = sourceWb.Sheets("Sheet1")
LastRow = WS.Range("A65536").End(xlUp).Row
For i = 2 To LastRow
Range("S" & i) = CleanTrim(Range("G" & i).Value)
Next i
do you know what is wrong?