Excel中想对表格中的所有格子进行VBA编程

在Excel中想对某张表格中的所有格子进行编程,VBA代码是什么?...
2026年09月25日 16:43
有3个网友回答
网友(1):

Sub ProcessAll()
Dim rC As Range
For Each rC In Cells
rC.Value = rC.Address ‘这里是你的处理
Next
Set rC = Nothing
End Sub

网友(2):

选中某张表格中的所有格子:
dim rag as range
for each rag in selection
'do something
next

网友(3):

比如Cells.clear