Friday, August 23, 2013

Use Split in VBA

Sub useSplitinVBA()
Dim myarry1 As Variant
Dim i As Integer
On Error Resume Next
myarry1 = Split(Sheet1.Cells(1, 1).Value, "\")
    For i = LBound(myarry1) To UBound(myarry1)
 
        If WorksheetFunction.Find(",", myarry1(i)) > 0 Then
        myarry2 = Split(myarry1(i), ",")
            For k = LBound(myarry2) To UBound(myarry2)
            MsgBox myarry2(k)
            Next
        End If
 
    Next
End Sub

No comments:

Post a Comment