I have a sheet which has date with extra space at end. And i want to remove them so that i can format them as date and sort excel sheet. I used macros available online for ex:
Sub TrimColumnA()
Dim rng As Range
On Error Resume Next ''#if entire column is blank, exit sub
Set rng = Intersect(Range("B1").EntireColumn, ActiveSheet.UsedRange)
rng.Value = Evaluate("IF(ROW(" & rng.Address & "),IF(" & rng.Address & _
"<>"""",TRIM(" & rng.Address & "),""""))")
End Sub
I also tried other macros, it works and removes spaces but i have to double click in each cell and then they format into date. How can i avoid clicking and directly remove space and format them into date.
Version- Excel 2007