title: Removing A part of Cell value in VBA
body: <p>I am trying to remove a part from cell values but its not working. </p>
  
  <p>Sample content of a cell:(Sample Input)</p>
  
  <pre><code>="*sls*lmt"&amp;CONCATENATE("_",'C:\Users\Administrator\AppData\Roaming\Microsoft\AddIns\XL-EZ Addin.xla'!COLUMNLETTER(C14),TEXT(ROW(),"0"))&amp;"_sel*range(status)*0*GOOD|OK|0|#00D700|0|100|80*NOT GOOD|NG|0|#FFFF00|0|79|50*FAULTED|FAULTED|0|#FF0000|1|49|0"
  </code></pre>
  
  <p>Sample Output:</p>
  
  <pre><code>="*sls*lmt"&amp;CONCATENATE("_",!COLUMNLETTER(C14),TEXT(ROW(),"0"))&amp;"_sel*range(status)*0*GOOD|OK|0|#00D700|0|100|80*NOT GOOD|NG|0|#FFFF00|0|79|50*FAULTED|FAULTED|0|#FF0000|1|49|0"
  </code></pre>
  
  <p>and I want to remove this part from value</p>
  
  <pre><code>'C:\Users\Administrator\AppData\Roaming\Microsoft\AddIns\XL-EZ Addin.xla'
  </code></pre>
  
  <p>Here is what I have tried</p>
  
  <pre><code>Sub UpdateSheetButton()
  Dim subStr1 As String
  Dim subSrrt2 As String
  
  Dim pos As Integer
  
  For Each Cell In ActiveSheet.UsedRange.Cells
  pos = InStr(Cell.Value, "'C:\")
  If pos &gt;= 1 Then
    subStr1 = Split(Cell.Value, "'C:\", 1)
    subStr2 = Split(Cell.Value, "\AddIns\XL-EZ Addin.xla'", 2)
    Cell.Value=subStr1 +subStr2 
    End If
  Next
  
  End Sub
  </code></pre>
  
  <p><strong>Error:</strong>
  Runtime error '13'
  Type Mismatch
  on this line </p>
  
  <pre><code>pos = InStr(Cell.Value, "'C:\")
  </code></pre>