你要的三个数据是指一个数字为一个数据?如果是这样的话,你先把text的multiline属性设置为true,然后Option Explicit’方法1Private Sub command1_click()Dim tempTxt As String, i As Integer, j As IntegertempTxt = Text1Text1 = ""For i = 1 To Len(tempTxt)Text1 = Text1 & Mid(tempTxt, i, 1)j = j + 1If j = 3 Thenj = 0Text1 = Text1 & vbCrLfEnd IfNext iEnd Sub’方法2Private Sub Command2_Click()Dim tempTxt As String, i As IntegertempTxt = Text1Text1 = ""For i = 1 To 3 * (Len(tempTxt) \ 3) Step 3Text1 = Text1 & Mid(tempTxt, i, 3) & vbCrLfNextFor i = 3 * (Len(tempTxt) \ 3) + 1 To Len(tempTxt)'如果能够保证数据是3的倍数那就不用这段代码了··呵呵··Text1 = Text1 & Mid(tempTxt, i, 1)Next
|