Bonjour hakkiletah,
je pense avoir décelé un problème sur le code,
si jamais il n'y a pas de données transférées en colonne A, mais en colonne B le calcul de la dernière ligne ne se fait pas.
alors si c'est le cas il faut modifier comme ça,
Sub test()
Set sh1 = Sheets("Liste_UO")
Set sh2 = Sheets("Juin")
Set plg1 = sh1.Range("Tableau_Liste_UO[Code UO]")
Set plg2 = sh2.Range("Tableau_Juin[Code UO]")
LastRw2 = sh2.Cells(Range(plg2.Address).Rows.Count, "B").End(xlUp).Row + 1
For Each c In plg1
x = c.Row
Z = plg1.Address
If IsError(Application.Match(c, plg2, 0)) Then
Err.Clear
If sh1.Cells(c.Row, "F") > DateSerial(Year(Date), 6, 1) Then
If c Like "*Excel*" Or c Like "*Potent*" Then
If sh1.Cells(c.Row, "G") = "Facturée" Or sh1.Cells(c.Row, "G") = "N/A" Then
sh2.Cells(LastRw2, "B") = c.Value
sh2.Cells(LastRw2, "I") = sh1.Cells(c.Row, "F") ' pour exemple seulement
LastRw2 = sh2.Cells(Range(plg2.Address).Rows.Count, "B").End(xlUp).Row + 1
End If
End If
End If
End If
Next
End Sub