title: Excel vba find and replace at end
body: <p>I have to replace the variant at end only. can we do that if so please can anyone help on this?</p>
  
  <p>code:</p>
  
  <pre><code>Worksheets("Part_Number").Columns("F").Replace What:="-G", Replacement:=" ", SearchOrder:=xlByColumns, MatchCase:=True
  </code></pre>
  
  <p>Input:<br></p>
  
  <pre><code>WA-2001-G 
  WA-GSK024
  </code></pre>
  
  <p>Expected Output:<br></p>
  
  <pre><code>WA-2001 
  WA-GSK024
  </code></pre>