2012年4月16日 星期一

VBA 分割字串 split string

Sub SplitValue()
    Dim avarSplit As Variant
    Dim intIndex As Integer
    avarSplit = Split(Range("A1").Value, ",")
    For intIndex = LBound(avarSplit) To UBound(avarSplit)
        MsgBox "Item " & intIndex & " is " & avarSplit(intIndex) & _
        " which is " & Len(avarSplit(intIndex)) & " characters long", vbInformation
    Next
End Sub 




Reference :

Split Function (Visual Basic)
String Split in vba

沒有留言:

張貼留言