Excel VBA, Split()
Option Base 1
Sub test()
Sub test()
Dim fruit As Variant
fruit = Split("apple,banana,cranberry,grape,orange", ",")
MsgBox fruit(0) 'apple
MsgBox fruit(1) 'banana
MsgBox fruit(0) 'apple
MsgBox fruit(1) 'banana
MsgBox fruit(2) 'cranberry
MsgBox fruit(3) 'grape
MsgBox fruit(4) 'orange
' Regardless of Option Base 1, it starts 0
' Split - Variant
End Sub
댓글
댓글 쓰기