Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rango_a_calcular As Range
Set rango_a_calcular = Range("D3:F12")
If Not Application.Intersect(rango_a_calcular, Range(Target.Address)) Is Nothing Then
For i = 1 To rango_a_calcular.Rows.Count
Dim fila_actual As Integer
Dim medida_2 As Integer
Dim medida_3 As Integer
Dim medida_4 As Integer
fila_actual = rango_a_calcular.Rows(i).Row
medida_2 = Cells(fila_actual, 4).Value
medida_3 = Cells(fila_actual, 5).Value
medida_4 = Cells(fila_actual, 6).Value
Cells(fila_actual, 8 ).Value = (medida_2 + medida_3 + medida_4) / 3
End If
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment