如果我有这个,例如:
Sub ExampleThing()
Counter = 13
For i = 1 To Counter
Range("A" & i) = Rnd
Next
Range("B1").Formula = "=(PI()*A1)"
Range("B1").Select
Selection.AutoFill Destination:=Range("B1:B" & Counter), Type:=xlFillDefault
End Sub
如果我想使用 Cells(),而不是使用 Destination 下的 Range(),该怎么办?就像,不是在 range 函数中使用单元格引用,而是用 Cells() 替换它,如下所示:
Selection.AutoFill Destination:=Range("Cells(1,2):Cells(Counter,2)"), Type:=xlFillDefault
我一直在玩它,似乎无法让它工作。