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

2025-04-06 04:19:04
推荐回答(1个)
回答1:

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
先选择区域
必须是连续的区域哦