我需要更改例如以下字符串153,154,155,156
至153**,**154**,**155**,**156
所以,
到**,**
我怎么能在 VBA 中做到这一点?
Replace()
在 MSDN 上
Sub ReplaceInStr()
Dim str As String
str = "153,154,155,156"
str = Replace(str, ",", "**,**")
MsgBox str
End Sub
不是更好,而是不同:
Sub SplitJoin()
Debug.Print Join(Split("153,154,155,156", ","), "**,**")
End Sub
尝试这个:
Dim s as String
s = "153,154,155,156"
s = Replace(s, ",", "**,**")