
For Each Cella In Area2
Nome = Cella
Set Riga = Area1.Find(Nome, LookIn:=xlValues, LookAt:=xlWhole)
If Riga Is Nothing Then
ws3.Cells(R, 8) = Cella
ws3.Cells(R, 9) = "Nuovo Prodotto"
R = R + 1
End If
Next Cella |
Sub Rimuovi()
Set ws3 = Sheets("261213")
Set ws1 = Sheets("251210")
ur = ws3.Cells(ws3.Rows.Count, "A").End(xlUp).Row
ur2 = ws1.Cells(ws1.Rows.Count, "A").End(xlUp).Row
Set Area2 = Sheets("251210").Range("A1:A" & ur2)
Range("A1:A" & ur).AdvancedFilter Action:=xlFilterInPlace, Unique:=True
Set Area1 = ws3.Range("A1:A" & ur).SpecialCells(xlCellTypeVisible)
For Each Cella In Area1
Nome = Cella
Set Riga = Area2.Find(Nome, LookIn:=xlValues, LookAt:=xlWhole)
If Riga Is Nothing Then
R = R + 1
ws3.Cells(R, 8) = Cella
ws3.Cells(R, 9) = "Nuovo Prodotto"
End If
Next Cella
If ws3.FilterMode Then
ws3.ShowAllData
End If
Set ws1 = Nothing
Set ws3 = Nothing
Set Area1 = Nothing
Set Area2 = Nothing
End Sub
|
Sub RimuoviCountif()
Set ws3 = Sheets("261213")
Set ws1 = Sheets("251210")
ur = ws3.Cells(ws3.Rows.Count, "A").End(xlUp).Row
ur2 = ws1.Cells(ws1.Rows.Count, "A").End(xlUp).Row
Set Area2 = ws1.Range("A1:A" & ur2)
Range("A1:A" & ur).AdvancedFilter Action:=xlFilterInPlace, Unique:=True
Set Area1 = ws3.Range("A1:A" & ur).SpecialCells(xlCellTypeVisible)
For Each Cella In Area1
Nome = Cella
If Application.CountIf(Area2, Cella) = 0 Then
R = R + 1
ws3.Cells(R, 8) = Cella
ws3.Cells(R, 9) = "Nuovo Prodotto"
End If
Next Cella
If ws3.FilterMode Then
ws3.ShowAllData
End If
Set ws1 = Nothing
Set ws3 = Nothing
Set Area1 = Nothing
Set Area2 = Nothing
End Sub |
