[RESOLVED] Parsing Words from Visio Form Textbox
Hello,
I am trying to extract the individual words that are comma delimited in a userform textbox into an array where each word has its own reference in the array.
For example, if the following is put in the textbox:
CMD,EXT,VEH,PER
I want an array 'A' with
A(1) = CMD
A(2) = EXT
.
.
.
I've found a couple VBA examples on parsing sentences, but Visio doesn't seem to have the same functions that they are using. Can anyone lend me a hand. I am new to VBA.
Re: Parsing Words from Visio Form Textbox
a = split(textbox1, ",")
if that does not work, specify the version of vba included with visio
Re: Parsing Words from Visio Form Textbox
Welcome to the forums :wave:
vb Code:
Sub Sample()
'~~> Replace MyArray() by A() if you wish
Dim MyArray() As String
'~~> I am using StrSample as an example.
'~~> Replace it with Textbox1.Text
StrSample = "CMD,EXT,VEH,PER"
'~~> Split the string based on the delimiter
MyArray = Split(StrSample, ",")
'~~> This is to just display what the array contains
'~~> Replace it with your code
For i = 0 To UBound(MyArray)
MsgBox MyArray(i)
Next i
End Sub
Edit: Pete beat me to it :D