Eg text : origin_code: string[5]; -> To extract string between '[' and ']'. i.e. 5 here.
Private Sub Datatypebytes_Click()
row_number = 0
Dim firstDelPos As Integer
Dim secondDelPos As Integer
Dim stringBwDels As String
If InStr(items, "string[") Then
strValue = Sheets("Sheet1").Range("A" & row_number)
firstDelPos = InStrRev(strValue, "[")
secondDelPos = InStrRev(strValue, "]")
stringBwDels = Mid(strValue, firstDelPos + 1, secondDelPos - (firstDelPos + 1))
Sheets("Sheet1").Range("B" & row_number) = stringBwDels
End If
No comments:
Post a Comment