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
|
'Valeur pour Affectation
Dim aff As String
Dim aff_rad As String
Dim id_aff As String
If Application.VLookup(ComboBox_Affectation, Worksheets("DONNEE").Range("b:b"), 1, False) <> ComboBox_Affectation Then
'recherche ou ecrire dans donne quantitatif
Dim lig_aff As Long
lig_aff = 2
'si <> de liste, rechecher ligne ecriture,stockage valeur, ecriture dans onglet base
Do While Not IsEmpty(Worksheets("DONNEE").Range("a" & lig_aff))
lig_aff = lig_aff + 1
Loop
id_aff = lig_aff - 1
aff = ComboBox_Affectation
aff_rad = TextBox_Affectation_Radio
Worksheets("DONNEE").Range("a" & lig_aff) = lig_aff - 1 'id
Worksheets("DONNEE").Range("b" & lig_aff) = ComboBox_Affectation
Worksheets("DONNEE").Range("c" & lig_aff) = TextBox_Affectation_Radio
Worksheets("DONNEE").Range("d" & lig_aff) = lig_aff - 1 'id
Else
'si = liste, stockage des valeur
aff = ComboBox_Affectation
aff_rad = Application.VLookup(ComboBox_Affectation, Worksheets("DONNEE").Range("b:c"), 2, False)
id_aff = Application.VLookup(ComboBox_Affectation, Worksheets("DONNEE").Range("b:d"), 3, False)
end if |
Partager