Muflix
Muflix

Reputation: 6798

VBA Excel work with strings

I have following string values in cells like

"EnglishText / OtherLanguageText"
or
"UniversalText"

I need to get 2 substrings from that like "EnglishText" and "OtherLanguageText" or "UniversalText" (text which not contain "/")

Im selecting data with command

wbImportFrom.Sheets("Sheet 4").Cells(4, 6 + x).Value

How can i do that ? :-) Thank you

Upvotes: 1

Views: 191

Answers (1)

Tyler
Tyler

Reputation: 58

Check out the Split function, and use the "/" as the delimiter.

Something like

My_String = Sheets("Sheet 4").cells(4, 6 + x).value
String_array = Split(My_String,"/")

should do the trick. Bear in mind that you will then be working with an array.

Source: http://msdn.microsoft.com/en-us/library/6x627e5f(v=vs.90).aspx

Upvotes: 3

Related Questions