View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
bioyyy bioyyy is offline
external usenet poster
 
Posts: 22
Default HELP to correc this macro

I got an error: (Run-time error '1004': Application-defined or object-defined
error).

Thanks,

Sub Avg3Row()

Dim OutputRow As Integer

OutputRow = 1

For Row = Selection.Row To ActiveSheet.UsedRange.Rows.Count Step 30
Worksheets("Output").Cells(OutputRow, 1).Formula = "=average(Input!B" &
Row - 3 & ":B" & Row & ")"
OutputRow = OutputRow + 1
Next Row
End Sub