Vb form read text box data, such as 067309010000100010010
How to extract some data turned it into 73090100001-0001
CodePudding user response:
First clear what are the rules, and then use the mid function to extractCodePudding user response:
Option Explicit
Private Sub Command1_Click ()
Dim strTmp As String
Text1="067309010000100010010"
StrTmp=Mid (Text1, 3, 11) & amp; "-" & amp; Mid (Text1, 14, 4)
MsgBox strTmp
'73090100001-0001
End Sub
CodePudding user response:
You haven't said that according to the rules to takeMainly rules
Commonly used functions are mid left right InStr
This a few should be enough