1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| Sub CreaLicences2()
Dim listing As Worksheet
Set listing = Sheets("Listing joueurs")
Dim cel As Range, Ws As Worksheet, trouve As Boolean
Application.ScreenUpdating = False
'Initialisation de la variable
trouve = False
For Each cel In Range("Noms").SpecialCells(xlCellTypeVisible)
If cel.Value <> "" Then
'Recherche moins couteuse
If Feuille_Existe(cel.Value & " " & listing.Cells(cel.Row, 2)) Then
trouve = True
End If
If trouve = False Then
With Sheets("Base Licence")
.Range("D4") = cel
.Range("D5") = listing.Cells(cel.Row, 2)
.Range("D6") = listing.Cells(cel.Row, 3)
.Range("D7") = listing.Cells(cel.Row, 6)
.Range("D9") = listing.Cells(cel.Row, 11)
.Range("D10") = listing.Cells(cel.Row, 12)
.Copy after:=Sheets(Sheets.Count)
With ActiveSheet
.Range("A1:G21") = .Range("A1:G21").Value
.Range("B1").Validation.Delete
.Name = cel & " " & listing.Cells(cel.Row, 2)
End With
End With
' appel la fonction pour mettre l'image
Affiche_Image (cel.Value & " " & listing.Cells(cel.Row, 2))
End If
End If
trouve = False
Next
Application.ScreenUpdating = True
listing.Activate
End Sub |
Partager