How to split a string with multiple delimiters in vba excel?

后端 未结 6 896
终归单人心
终归单人心 2021-01-01 14:53

I want to split a string with multiple delimiters using Excel VBA. One of the strings is:

d1-d2 d3 d4  

We have a dash and a space as tw

6条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-01 15:35

    in which case you could do

        newString = Replace(origString, "-", " ")
        newString2 = replace(newstring, "  " , " ")
        newArray = SPlit(newString, " ")
    

提交回复
热议问题