Monday 19 October 2015

Simple split VBA function with comma seprated values

Sub Split_2()

Dim name As String
Dim Split_name() As String ' Array String

name = InputBox("Enter your name using comma between first & last name: ")

Split_name = Split(name,",") ' Split function used - comma seprated

Range("a1").Value = Split_name(0) 'stored value before space
Range("b1").Value = Split_name(1) ' stored value after space

End Sub

No comments:

Post a Comment