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

后端 未结 6 909
终归单人心
终归单人心 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:16

    To split with several different delimiters ; list the delimiters in an array, replace them with a for loop, then split :

    For Each tSep In Array(";", " ", ".", "<==", ":", vbCr)
        val1 = Replace(val1, tSép, "°")
    Next tSep
    tab1 = Split(val1, "°")
    

提交回复
热议问题