VBscript用于查找字符串并将其替换为换行符

时间:2013-12-03 13:07:46

标签: excel vbscript ms-word

我需要一个脚本来查找给定段落中的":;,并将它们转换为换行符。

示例:

what ; when " you : like

应转换为

what
when
you
like

1 个答案:

答案 0 :(得分:0)

也许:

Sub luxation()
    Dim s1 As String, s2 As String, s3 As String, s4 As String
    s1 = Chr(34)
    s2 = ":"
    s3 = ";"
    s4 = Chr(10)
    Cells.Replace s1, s4
    Cells.Replace s2, s4
    Cells.Replace s3, s4
End Sub