怎样用VB宏执行:在excel中的单元格里删除不想要的字符?

如题所述

Sub 按钮1_单击()

a = Selection.Row
a1 = Selection.Rows.Count
b = Selection.Column
b1 = Selection.Columns.Count

For i = a To a + a1 - 1
For j = b To b + b1 - 1

Cells(i, j) = Replace(Cells(i, j), "aaaa", "")
'Cells(i, j) = Replace(Cells(i, j), Range("a1"), "")

Next j
Next i

End Sub
先选择区域
必须是连续的区域哦
温馨提示:答案为网友推荐,仅供参考
相似回答