
Sub cerca_riga()
Dim rng As Range, riga As Range
Dim i As Integer, c As Integer
Set rng = [gc2:gh38]
For Each riga In rng.Rows
For i = 1 To 12
c = c + WorksheetFunction.CountIf(riga, Cells(i, 1))
Next
If c >= 3 Then riga.Copy [af12]: Exit Sub
c = 0
Next
End Sub
|
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [A12]) Is Nothing Then Exit Sub
'richiamo la macro di prima
cerca_riga
End Sub
|
Sub cerca_riga()
Dim rng As Range, riga As Range
Dim i As Integer, c As Integer
Set rng = [n2:s38]
For Each riga In rng.Rows
For i = 1 To 12
c = c + WorksheetFunction.CountIf(riga, Cells(i, 1))
Next
If c >= 3 Then
riga.Copy
[d19].PasteSpecial xlValues
Exit Sub
End If
c = 0
Next
MsgBox "Nessuna riga con 3 valori"
End Sub
|
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [A12]) Is Nothing Then Exit Sub
'richiamo la macro di prima
cerca_riga
End Sub
per non far apparire i numeri quando cancello la cella A12, la modificassi così va bene?
Private Sub Worksheet_Change(ByVal Target As Range)
if [A12]="" then Range("AF12", "AK12").Clear.Contents
end if
If Intersect(Target, [A12]) Is Nothing Then Exit Sub
'richiamo la macro di prima
cerca_riga
End Sub |
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A12")) Is Nothing Then
If Range("A12") = "" Then
Range("AF12:AK12").ClearContents
Else
cerca_riga
End If
End If
End Sub |
