
in D4 = SE( B4 = "verifica" ; SE (D4 < J4; J4; D4); D4) in J4 = SE( B4 = "verifica" ;SE (D4 > J4; D4; J4); J4) ' |
Option Explicit
Sub verifica()
Dim ur As Long, i As Long
ur = Cells(Rows.Count, 4).End(xlUp).Row
For i = 4 To ur
If Cells(i, 2) = "verifica" Then
If Cells(i, 4) < Cells(i, 10) Then
Cells(i, 4) = Cells(i, 10)
ElseIf Cells(i, 4) > Cells(i, 10) Then
Cells(i, 10) = Cells(i, 4)
End If
End If
Next i
End Sub |
