Macro to Clean Text

  • Thread starter Thread starter ksp
  • Start date Start date
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
 
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
 
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)
 
Thanks everyone for your input

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

Ta

K
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top