title: Excel VBA - Unable to remove extra spaces between words using Trim and similar functions
body: <p>I am trying to remove unnecessary white space in a string using VBA but the trim funciton doesn't seem to work for me. I want to remove the extra space between 'End' and 'Time' in this hypothetical example. </p>
  
  <pre><code>Public Sub RemoveSpaces()
  
      Dim s As String: s = "START TIME: N/A END     TIME: N/A "
  
      s = Trim(s)
  
      Debug.Print s
  
      End Sub
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/5qUVL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5qUVL.png" alt="enter image description here"></a></p>