VBA Loop on text with split

Опубликовано: 19 Октябрь 2024
на канале: Simplified Excellence
32
0

Loop on words in a symbol delimited text with the function SPLIT.

Code:
Sub loop_on_text_with_split()

Dim myList As String
Dim array_myList() As String

'identify my semi colon delimited text
myList = "Orange;Red;Blue"

'define array - transform text in one row for each entry between semi colons
array_myList = Split(myList, ";")

'loop on array
For i = LBound(array_myList) To UBound(array_myList)
'display value
MsgBox ("Value is: " & array_myList(i))
Next

End Sub

-------------------------------
NEED HELP?
-------------------------------
Leave a comment with your questions, issues or projetcs and I will try to answer with a video.

-------------------------------
THANK YOU
-------------------------------
For watching my videos,
Your shares
And your comments!