更新时间:2023-12-06 11:36:40
您将myRows
作为Variant
数据类型.您需要将其声明为Range
对象.
You have myRows
as a Variant
data type. You need to declare it as a Range
object.
Dim myRows as Range
然后,您需要使用Set
关键字来分配Range
对象).
Then you would need to use the Set
keyword to assign a Range
object).
Set myRows = Range("1:10")
然后,使用范围.Resize
方法:
Set myRows = myRows.Resize(myRows.Rows.Count+1, myRows.Columns.Count)
否则,如果您需要将myRows
保持为Variant类型,请告知我,我可以对其进行重新处理.
Otherwise, if you need to maintain myRows
as type Variant, let me know and I can re-work this.