我需要改变,例如跟随字符串153,154,155,156
到153**,**154**,**155**,**156
所以,
到**,**
我怎么能在VBA中做到这一点?
答案 0 :(得分:4)
Sub ReplaceInStr()
Dim str As String
str = "153,154,155,156"
str = Replace(str, ",", "**,**")
MsgBox str
End Sub
答案 1 :(得分:4)
不是更好,但不同:
Sub SplitJoin()
Debug.Print Join(Split("153,154,155,156", ","), "**,**")
End Sub
答案 2 :(得分:3)
试试这个:
Dim s as String
s = "153,154,155,156"
s = Replace(s, ",", "**,**")