Private Sub btn_ok_Click()
Dim exp(), dest(), recep(), qte(), cp(), ville(), poids() As Variant
nbexp = 7
ReDim exp(nbexp)
ReDim dest(nbexp)
ReDim recep(nbexp)
ReDim qte(nbexp)
ReDim cp(nbexp)
ReDim ville(nbexp)
ReDim poids(nbexp)
For i = 1 To nbexp
exp(i) = Sheets("Données").Cells(2 + i, 42).Value
dest(i) = Sheets("Données").Cells(2 + i, 22).Value
recep(i) = Sheets("Données").Cells(2 + i, 2).Value
qte(i) = Sheets("Données").Cells(2 + i, 29).Value
cp(i) = Sheets("Données").Cells(2 + i, 27).Value
ville(i) = Sheets("Données").Cells(2 + i, 28).Value
poids(i) = Sheets("Données").Cells(2 + i, 30).Value
Next i
receplig = lst_crm.ListIndex
etiq = lst_etiq.Value
For j = 1 To (etiq / 1)
If j Mod 2 = 0 Then
col = 5
lig = j / 2
Else
col = 1
lig = (j + 1) / 2
End If
Sheets("Etiquettes").Cells(27 * (lig - 1) + 2, col).Value = "GEFCO"
Sheets("Etiquettes").Cells(27 * (lig - 1) + 5, col).Value = "Date édition étiquette :"
Sheets("Etiquettes").Cells(27 * (lig - 1) + 7, col).Value = "N° Récépissé :"
Sheets("Etiquettes").Cells(27 * (lig - 1) + 9, col).Value = "Expéditeur :"
Sheets("Etiquettes").Cells(27 * (lig - 1) + 11, col).Value = "Destinataire :"
Sheets("Etiquettes").Cells(27 * (lig - 1) + 13, col).Value = "CP / Ville :"
Sheets("Etiquettes").Cells(27 * (lig - 1) + 15, col).Value = "Nb total UM :"
Sheets("Etiquettes").Cells(27 * (lig - 1) + 17, col).Value = "Poids :"
Sheets("Etiquettes").Cells(27 * (lig - 1) + 5, col + 1).Value = Date
Sheets("Etiquettes").Cells(27 * (lig - 1) + 7, col + 1).Value = recep(receplig + 1)
Sheets("Etiquettes").Cells(27 * (lig - 1) + 9, col + 1).Value = exp(receplig + 1)
Sheets("Etiquettes").Cells(27 * (lig - 1) + 11, col + 1).Value = dest(receplig + 1)
Sheets("Etiquettes").Cells(27 * (lig - 1) + 13, col + 1).Value = cp(receplig + 1)
Sheets("Etiquettes").Cells(27 * (lig - 1) + 13, col + 2).Value = ville(receplig + 1)
Sheets("Etiquettes").Cells(27 * (lig - 1) + 15, col + 1).Value = qte(receplig + 1)
Sheets("Etiquettes").Cells(27 * (lig - 1) + 17, col + 1).Value = poids(receplig + 1)
Sheets("Etiquettes").Cells(27 * (lig - 1) + 19, col).Value = "Colis :"
Sheets("Etiquettes").Cells(27 * (lig - 1) + 19, col + 1).Value = j & "/" & (etiq / 1)
Next j
Unload UserForm1
Sheets("Etiquettes").Activate
End Sub