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 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| Sub RéinitCtl()
Dim i%
For i = 1 To 21
Controls("ctl" & i).Value = ""
Next i
ctl1.SetFocus
End Sub
Private Sub cbQuit_Click()
Unload Me
End Sub
Private Sub cbValid_Click()
For i = 1 To 21
If Controls("ctl" & i).Value = "" Then
MsgBox "Renseigner toute les rubriques !", vbCritical, "Saisie incomplète "
Exit Sub
End If
Next i
Dim j As Long
With Sheets("DAL")
j = .Range("A" & Rows.Count).End(xlUp).Row + 1
.Range("A" & j) = Controls("ctl1").Value
.Range("B" & j) = Controls("ctl2").Value
.Range("C" & j) = Controls("ctl3").Value
.Range("D" & j) = Controls("ctl4").Value
.Range("E" & j) = Controls("ctl5").Value
.Range("F" & j) = Controls("ctl6").Value
.Range("G" & j) = Controls("ctl7").Value
.Range("H" & j) = Controls("ctl8").Value
.Range("I" & j) = Controls("ctl9").Value
.Range("J" & j) = Controls("ctl10").Value
.Range("K" & j) = Controls("ctl11").Value
.Range("L" & j) = Controls("ctl12").Value
.Range("M" & j) = Controls("ctl13").Value
.Range("N" & j) = Controls("ctl14").Value
.Range("O" & j) = Controls("ctl15").Value
.Range("P" & j) = Controls("ctl16").Value
.Range("K" & j) = Controls("ctl17").Value
.Range("R" & j) = Controls("ctl18").Value
.Range("S" & j) = Controls("ctl19").Value
.Range("T" & j) = Controls("ctl20").Value
.Range("U" & j) = Controls("ctl21").Value
End With
RéinitCtl
End Sub |
Partager