
Private Sub CommandButton1_Click()
Dim rng As Range
Dim cl As Range
Set rng = Range("c10:c17")
For Each cl In rng
If cl = Cells(5, 3).Value Then
cl.Offset(, 3) = Cells(5, 6)
End If
Next
End Sub |
Private Sub CommandButton1_Click()
Dim RangeW As Range
Dim CellaW As Range
Dim TROVATO As Boolean
TROVATO = False
Set RangeW = Range("C10", Range("C10").End(xlDown))
For Each CellaW In RangeW
If CellaW = Range("C5").Value Then
Range("C5").Offset(0, 3) = CellaW.Offset(0, 3)
TROVATO = True
Exit For
End If
Next
If Not TROVATO Then
Range("C5").Offset(0, 3) = "Non Esiste"
End If
End Sub
|
