1

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

2
  • 2
    in VBA use Split() and on the spreadsheet =FIND() and =MID() Commented Aug 29, 2014 at 10:43
  • Thank you, i used instr() instead of FIND() Commented Aug 29, 2014 at 12:37

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.