Flora Edwards
asked on
VBA to trim leading and trailing spaces in all sheets of active workbook.
I had this question after viewing VBA how to delete all objects regardless of its type from all worksheets in workbook.
Rgonzo and Norie has helped me with this code. now i want to add something so that it quickly cleans up the leading and trailing spaces with Character 160 and character 10
Rgonzo and Norie has helped me with this code. now i want to add something so that it quickly cleans up the leading and trailing spaces with Character 160 and character 10
Sub Macro()
For Each sh In ActiveWorkbook.Worksheets
With sh.Cells.Font
.ColorIndex = xlAutomatic
.TintAndShade = 0
End With
With sh.Cells.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
For Each obj In sh.Shapes
obj.Delete
Next obj
Next
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER