您好我正在尝试编写 vba 来帮助我将每日数据转换为每周数据。我写了这个 vba 但说unable to get the average property of the worksheetfunction class
。有没有可能有人可以帮我找出问题所在?谢谢!
Sub CopyData()
Dim z As Integer
For z = 0 To 2000
Set Rng1 = ActiveSheet.Range("D5:D11").Offset(7 * z, 0)
Range("runningagain").Offset(z, 0) = Application.WorksheetFunction.Average(Rng1)
Do Until IsEmpty(ActiveCell.Value)
ActiveCell.Offset(1, 0).Select
Loop
Next z
End Sub