title: Remove last two characters
body: <p>I have written some code to go through a loop and if it finds "gb" in a cell i want to delete the last two characters in that cell.</p>
  
  <p>Here is the loop</p>
  
  <pre><code>Sub RemoveUnits()
      Dim r As Range
      Dim x As Long
      For Each r In ActiveSheet.UsedRange
          w = r.Value
          If InStr(w, "gb") &gt; 0 Then
              [INSERT CODE HERE]
          End If
      Next r
  End Sub
  </code></pre>
  
  <p>The bit i am stuck on is the code that removes the last two characters. I know it should go within this if statement but all the answers I have found online do not seem to work.</p>
  
  <p>Appreciate any help! Thanks.</p>