excel - How to Split a String and Store in variables? -


i want split string , store them in variable.

  getid = "13h4"   ssplit = split(getid) 

i want split them , store "13" in variable , "4" in variable.

i don't want use mid,right,left methods because don't want put location of string "13" or "4". guys know how it?

thanks guys.

here few possibilities show how can :

dim var1 string, _     var2 string, _     ssplit() string   getid = "13h4"    ssplit = split(getid, "h")   var1 = ssplit(0)   var2 = ssplit(1)  '--- or ---    var1 = split(getid, "h")(0)   var2 = split(getid, "h")(1) 

if want output numbers directly , not text of number, way :

dim var1 integer, _     var2 integer, _     ssplit() string    getid = "13h4"   ssplit = split(getid, "h")   var1 = cint(ssplit(0))   var2 = cint(ssplit(1)) 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -