close

Sub TEST4518()

Set regx = CreateObject("vbscript.regexp")

 

With regx

     .Global = True

     .Pattern = "[a-z]+ *[a-z]+"

     Set MAT = .Execute([A2])

     For Each m In MAT

         y = y + 1

         Cells(y, 2) = m

     Next

     y = 0

End With

 

With regx

     .Global = True

     .Pattern = "[-]+"

     Set MAT = .Execute([A2])

     For Each m In MAT

         y = y + 1

         Cells(y, 3) = m

     Next

     y = 0

End With

End Sub


arrow
arrow
    文章標籤
    VBA
    全站熱搜
    創作者介紹

    錦子老師 發表在 痞客邦 留言(0) 人氣()