MsgBox "将全表的A,替换为B,确定?"
Cells.Select
Range("A1").Activate
Selection.Replace What:="A", Replacement:="B"散银, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub
替换用replace就可以的。
Private Sub Command1_Click()Dim x As String
x = "A,B,C,D,E,F,G"
x = Replace(x, "A", "B")
x = Replace(x, "C", "D")
MsgBox x
End Sub
如果你说的ABCD是变让坦消量的话,上信和面的ABCD可自行赋坦知值,替换的时候按变量替换。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)