Hi all,
I'm looking to use the clean command on a single column rather than a whole worksheet. Can I do this?
I've got the following code so far:
I'm looking to use the clean command on a single column rather than a whole worksheet. Can I do this?
I've got the following code so far:
Code:
Sub cleanup()
Dim TheCell As Range
For Each TheCell In ActiveSheet.UsedRange
With TheCell
If .HasFormula = False Then
.Value = Application.WorksheetFunction.Clean(.Value)
End If
End With
Next TheCell
End Sub
[\Code]
This changes the whole worksheet.
I am trying to remove all cr and nl from my worksheet but they all appear in the same column. The problem with running the code on the whole worksheet is that it also removes leading zeros which I don't want to happen!
Any ideas anyone?
Cheers,
Woody