office交流網(wǎng)--QQ交流群號及微信交流群

Access培訓(xùn)群:792054000         Excel免費(fèi)交流群群:686050929          Outlook交流群:221378704    

Word交流群:218156588             PPT交流群:324131555

微信交流群(請用微信掃碼)

        

Split函數(shù)的使用方法

2019-11-16 01:30:00
zstmtony
原創(chuàng)
8556
Sub test1()
    Dim strTest As String
    Dim arrResult() As String
    Dim i As Integer
    strTest = "abc, edf, hij, klm"
    arrResult = VBA.Split(strTest , ",", 3)
    For i = LBound(arrResult) To UBound(arrResult)
        Debug.Print Trim(arrResult(i))
    Next i
End Sub


文本不區(qū)分大小寫


Sub test2()
    Dim strTest As String
    Dim arrResult() As String
    Dim i As Integer
    strTest = "AAAsBBBSCCCsDDDsEEEFF"
    arrResult = VBA.Split(strTest , delimiter:="s", compare:=vbTextCompare)
    For i = LBound(arrResult) To UBound(arrResult)
        Debug.Print Trim(arrResult(i))
    Next i
End Sub


分享
文章分類
聯(lián)繫我們
聯(lián)繫人: 王先生
Email: 18449932@qq.com
QQ: 18449932
微博: officecn01
移動訪問