- ©«¤l
- 109
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 114
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7 Win10
- ³nÅ骩¥»
- Office 2019 WPS
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ²`¦`
- µù¥U®É¶¡
- 2013-2-2
- ³Ì«áµn¿ý
- 2024-11-6
|
- Sub SplitText()
- Dim I As Long, J As Long
- Dim RegExp As Object
- Dim Match As Object
- Dim strNum As String
- Dim strValue As String
-
- Set RegExp = CreateObject("VBScript.RegExp")
- With Sheet2
- With RegExp
- .Global = True
- .Pattern = "\d+"
- End With
- For I = 2 To .Cells(.Rows.Count, 1).End(xlUp).Row
- strValue = .Cells(I, 1).Value
- Set Match = RegExp.Execute(strValue)
- If Match.Count Then
- strNum = Match.Item(0)
- .Cells(I, 2).Value = strNum
- J = InStr(strValue, strNum) + Len(strNum)
- If J Then .Cells(I, 3).Value = Mid$(strValue, J)
- Set Match = Nothing
- Else
- .Cells(I, 3).Value = strValue
- End If
- Next I
- End With
- End Sub
½Æ»s¥N½X |
|