我已经为范围创建了全局字符串常量。
Global Const Graph_Cl As String = "G2:G13"
Global Const Graph_Vl As String = "I2:I13"
Global Const Graph_VlS As String = "L2:L13"
我想使用一行代码清除这些范围。
With wkDataToUse
.Range(Graph_Cl, Graph_Vl, Graph_VlS).ClearContents
End With
但我得到错误:
"Wrong no of arguments or invalid property assignment!"
我什至试过这个:
With wkDataToUse
.Range(Array(Graph_Cl, Graph_Vl, Graph_VlS)).ClearContents
End With
或者
With wkDataToUse
.Range([{Graph_Cl, Graph_Vl, Graph_VlS}]).ClearContents
End With
如何清除一行代码中的所有范围?