Using this function you can now clean the leading or trailing spaces in the cell range
Function Clean_cells_in_range(ByRef Cells_to_Clean As String)
For Each cell In ActiveSheet.Cells.Range(Cells_to_Clean)
cell.Value = Trim(cell)
Next cell
End Function
For Each cell In ActiveSheet.Cells.Range(Cells_to_Clean)
cell.Value = Trim(cell)
Next cell
End Function
No comments:
Post a Comment