title: Select a part of Excel Cell (Not Complete Cell) and compare it to other cells
body: <p>I have part of a code for VBA to run and add blank rows after it finds non-sequential numbers in my data. However my data contains letters and the way the code is written it only compares integer sequences. Is there a way to manipulate the code to only select part of the cell and compare that part? </p>
  
  <p>For example I have the following sequence: </p>
  
  <pre><code>100-CG-000-10008
  100-CG-000-10009
  100-CG-000-10011
  100-CG-000-10012
  </code></pre>
  
  <p>and the idea is to get VBA to insert a blank row after <strong>100-CG-000-10009</strong> due to the fact that it is no longer in sequence after that. The code I'm working with is: </p>
  
  <pre><code>Sub InsertNullBetween()
    'Update 20130829
    Dim WorkRng As Range
    Dim Rng As Range
    Dim outArr As Variant
    Dim dic As Variant
    Set dic = CreateObject("Scripting.Dictionary")
    'On Error Resume Next
    xTitleId = "KutoolsforExcel"
    Set WorkRng = Application.Selection
    Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
    num1 = WorkRng.Range("A1").Value
    num2 = WorkRng.Range("A" &amp; WorkRng.Rows.Count).Value
    interval = num2 - num1
    ReDim outArr(1 To interval + 1, 1 To 2)
    For Each Rng In WorkRng
      dic(Rng.Value) = Rng.Offset(0, 1).Value
    Next
    For i = 0 To interval
      If dic.Exists(i + num1) Then
        outArr(i + 1, 1) = i + num1
        outArr(i + 1, 2) = dic(i + num1)
      Else
        outArr(i + 1, 1) = ""
        outArr(i + 1, 2) = ""
      End If
    Next
    With WorkRng.Range("A1").Resize(UBound(outArr, 1), UBound(outArr, 2))
      .Value = outArr
      .Select
    End With
  End Sub
  </code></pre>
  
  <p>Is there any way I can change the code to only look at the last part of the cell containing the integers after the 3rd "-"? </p>