Something like this?

VB Code:
  1. Sub SubStrings(strFirst As String, strSecond As String)
  2.  
  3. 'counter(i) will contain the no. of times a substring
  4. 'length i of strSecond appears in strFirst
  5.  
  6. Dim tmparr() As String
  7. Dim tmpStr As String
  8. Dim Counter() As Long
  9. Dim i As Long, j As Long
  10.  
  11. ReDim Counter(Len(strSecond) )
  12.  
  13. For i = 1 To Len(strSecond)
  14.     For j = 1 To Len(strSecond) - i + 1
  15.         tmpStr = Mid$(strSecond, j, i)
  16.         tmparr() = Split(strFirst, tmpStr, , vbBinaryCompare)
  17.         Counter(i) = UBound(tmparr()) + Counter(i)
  18.     Next j
  19. Next i
  20.  
  21. End Sub