I am using the code below to trim some "blank cells" that contain a space. The thing is it takes too much time, as is looping to every cell. What I want is to remove the spaces(the ones in the beginning and end, not middle), of all the cells.
Is there any easier way that I can apply all at once?
For a = 1 To ScenarioTableLastRow
For f = 1 To ScenarioTableLastColumn
If Cells(a, f) <> "" Then
Cells(a, f) = Excel.Application.Trim(Cells(a, f))
End If
Next f
Next a