
Dim v as Variant
v = Range("D2:D25")
Option Explicit Sub Media() Dim ValMedia As Double Dim i As Long For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row If Cells(i, 1) = "" Then Exit Sub Cells(i, 4) = Application.Average(Range(Cells(i, 1), Cells(i, 3))) Next i End Sub |
