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
| Sheets("TRAVAIL").Select
Dim a As Integer: a = 1
While Not IsEmpty(Cells(a, 1))
a = a + 1
Wend
Cells(a, 1).Value = Textnumpiece.Text
Cells(a, 2).Value = Textctrecouts.Text
Cells(a, 3).Value = Textnatcompt.Text
Cells(a, 4).Value = Textdesnatcompt.Text
Cells(a, 5).Value = Textcptcpart.Text
Cells(a, 6).Value = Textutilisateur.Text
Cells(a, 7).Value = Textentete.Text
Cells(a, 8).Value = Textref.Text
Cells(a, 9).Value = Textdesign.Text
Cells(a, 13).Value = Textdatepiece.Text
Cells(a, 11).Value = Textdatecpt.Text
Cells(a, 12).Value = Textsaisie.Text
Cells(a, 10).Value = Textvaleur.Value
Dim D As Integer
' Trouver la colonne pour affectation
D = Cells.Find(What:=Comboaffectations.Value, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Column
' Mettre la valeur dans la cellule concernée pour l'affecter dans la bonne colonne
Cells(a, D).Value = Cells(a, 10).Value |