I am trying to remove all spaces from cells in a specific column. I found this question,which has an answer:How to remove spaces from an entire Excel column using VBA?
This is how I adapted the answer:
For i = 2 To n
Cells(i, 17).Value = Replace(Cells(i, 17).Value, " ", "")
Next i
It does eliminate the space but it also eliminates a comma. For example "424, 426" changes to "424426".
I did run my code one part at a time to make sure that the problem indeed happens in that specific cope block.
How should I change the code to make sure that only the spaces get eliminated?