Y asi:
Option Explicit
Public MyBytePos() As Long
Public MyByteArray() As Byte
Public Const StrByteArray As String = "255,254,253,0,252,0,0,0,251,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,250,0,0,0,0,0,0," & _
"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,0," & _
"0,0,3,4,248,3,0,247,246,5,6,2,245,244,5,6,243,242,7,241,8,240,9,10,239,9,11,12,8,238,11," & _
"13,13,10,237,8,236,14,8,9,235,13,8,7,13,8,7,234,233,8,12,10,232,14,231,15,15,230,229,0,0,0," & _
"0,0,0,0,228,227,226,16,5,2,17,18,5,2,17,18,5,2,17,18,225,224,4,18,223,2,17,18,222,19,18," & _
"18,20,2,17,18,21,22,221,18,220,2,17,18,21,22,219,18,23,2,17,18,5,2,218,18,16,2,17,18,21,22," & _
"217,18,19,2,17,18,21,22,216,218,23,2,17,18,21,22,215,18,20,2,17"
Public MaxArray As Integer
Public Sub ConfigArray()
Dim I As Integer
Dim Pos As Double
Dim NewPos As Double
Dim SplitOneTime() As String
SplitOneTime = Split(StrByteArray, ",")
MaxArray = UBound(SplitOneTime)
ReDim MyBytePos(0 To MaxArray)
ReDim MyByteArray(0 To MaxArray)
Pos = 1
For I = 0 To MaxArray
MyByteArray(I) = CByte(SplitOneTime(I))
If I = 0 Then
MyBytePos(I) = 1
Else
MyBytePos(I) = (MyBytePos(I - 1) + Len(SplitOneTime(I - 1))) + 1
End If
Next I
'MsgBox MyBytePos(5) ' = 19
'MsgBox MyBytePos(40) ' = 93
End Sub
Public Sub Stuff()
Dim I As Integer
Dim CurrentByte As Byte
Dim found As Double
Dim CurrentPos As Double
Dim NextPos As Double
Dim FirstPattern As String
Dim SecondPattern As String
For I = 0 To MaxArray
'Ejemplo, index 5 -> 255,254,253,0,252,0,0,0,251,0,0,0,1,1,0,0,0
CurrentByte = MyByteArray(I)
If I = 103 Then
Stop
CurrentPos = MyBytePos(I)
NextPos = MyBytePos(I + 1)
found = InStr(NextPos, StrByteArray, CurrentByte)
FirstPattern = Mid(StrByteArray, CurrentPos, found - CurrentPos) '= "13,8,7,"
SecondPattern = Mid(StrByteArray, found, found - CurrentPos) '= "13,8,7,"
MsgBox StrComp(FirstPattern, SecondPattern) = 0
End If
Next I
End Sub