title: How to remove spaces from an entire Excel column using VBA?
body: <p>I'm trying to delete the spaces that I have in each field of the column "A" this spaces are at the end of the string some of the string has 3 spaces others 4. When I run the code, I don't have error, so I think I have a bug because nothing happened when is running.</p>
  
  <pre><code>Dim result As String
  Last = Cells(Rows.Count, "A").End(xlUp).Row
      For i = Last To 1 Step -1
        If (Right(Cells(i, "A").Value, 4)) Like "    " Or (Right(Cells(i, "A").Value, 3)) Like "   " Then
          result = Replace(Cells(i, "A"), " ", "")
      End If
  Next i
  </code></pre>