nix, shell, perl, php, mysql and mac os x tips and tricks

Tuesday, September 28, 2004

VB to strip carriage returns from cells in an Excel file

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

No comments:

Post a Comment