Macro to Clean Text

K

ksp

Does anyone have a macro that will clean all text within a workshee
without me having to insert he function clean(A1) etc and then copy an
paste the results

Thanks

K
 
K

kounoike

Is this do what you want to do?

Sub testme()
Dim rng As Range
For Each rng In Cells.SpecialCells(xlCellTypeConstants)
rng = Application.Clean(rng)
Next
End Sub

keizi
 
B

Bob Phillips

Sub CleanText()
Dim cell As Range

For Each cell In Selection
cell.Value = Application.Clean(cell.Value)
Next cell

End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
K

ksp

Thanks everyone for your input

Knew it would be easy for those of you that know how

Ta

K
 
Top