codewala

code it

Macro to convert String into Array


'----------------------------------
Option Explicit
'
Sub ConvertStringToArray()
'
Dim media_str As String
Dim media() As String
Dim mediaLen As Long
Dim m As Long
'
media_str = "abc.wav , xyz.wmv , efg.jpg"
media() = Split(media_str, ",")
mediaLen = UBound(media)
'
For m = 0 To mediaLen
MsgBox media(m)
Next m
'
End Sub
'----------------------------------

Advertisements

January 6, 2011 - Posted by | VBA, Word

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: