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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
Private Sub userform_Initialize()
Sheets("sauvegarde").Select
ComboBox1.RowSource = "A2:A" & Range("A65536").End(xlUp).Row
Dim NUM As Integer
ComboBox1.Value = NUM
TextBox22.Value = Range("B" & NUM + 1)
TextBox23.Value = Range("C" & NUM + 1)
TextBox1.Value = Range("D" & NUM + 1)
TextBox2.Value = Range("E" & NUM + 1)
TextBox3.Value = Range("F" & NUM + 1)
TextBox4.Value = Range("G" & NUM + 1)
TextBox5.Value = Range("H" & NUM + 1)
TextBox6.Value = Range("I & num + 1")
TextBox7.Value = Range("J" & NUM + 1)
TextBox8.Value = Range("K" & NUM + 1)
TextBox9.Value = Range("L" & NUM + 1)
TextBox10.Value = Range("M" & NUM + 1)
TextBox11.Value = Range("N" & NUM + 1)
TextBox12.Value = Range("O" & NUM + 1)
TextBox13.Value = Range("P" & NUM + 1)
TextBox14.Value = Range("R" & NUM + 1)
TextBox15.Value = Range("S" & NUM + 1)
TextBox16.Value = Range("U" & NUM + 1)
TextBox17.Value = Range("V" & NUM + 1)
TextBox18.Value = Range("X" & NUM + 1)
TextBox19.Value = Range("Y" & NUM + 1)
TextBox20.Value = Range("Z" & NUM + 1)
TextBox24.Value = Range("AP" & NUM + 1)
TextBox25.Value = Range("AQ" & NUM + 1)
End Sub
Private Sub btnQuitter_Click()
Unload Me
Sheets("analyse").Select
ActiveSheet.Protect "1234"
End Sub
Private Sub btnValider_Click()
Dim Ligne As Long
With ThisWorkbook.Sheets(2)
If Modification Then
Ligne = ActiveCell.Row
Else
Ligne = .Range("A65536").End(xlUp).Row + 1
End If
Sheets("sauvegarde").Unprotect "1234"
.Cells(Ligne, 1) = Label62
.Cells(Ligne, 2) = TextBox22
.Cells(Ligne, 3) = TextBox23
.Cells(Ligne, 4) = TextBox1
.Cells(Ligne, 5) = TextBox2
.Cells(Ligne, 6) = TextBox3
.Cells(Ligne, 7) = TextBox4
.Cells(Ligne, 8) = TextBox5
.Cells(Ligne, 9) = TextBox6
.Cells(Ligne, 10) = TextBox7
.Cells(Ligne, 11) = TextBox8
.Cells(Ligne, 12) = TextBox9
.Cells(Ligne, 13) = TextBox10
.Cells(Ligne, 14) = TextBox11
.Cells(Ligne, 15) = TextBox12
.Cells(Ligne, 16) = TextBox13
.Cells(Ligne, 18) = TextBox14
.Cells(Ligne, 19) = TextBox15
.Cells(Ligne, 21) = TextBox16
.Cells(Ligne, 22) = TextBox17
.Cells(Ligne, 24) = TextBox18
.Cells(Ligne, 25) = TextBox19
.Cells(Ligne, 26) = TextBox20
.Cells(Ligne, 42) = TextBox24
.Cells(Ligne, 43) = TextBox25
ActiveSheet.Unprotect "1234"
Sheets("sauvegarde").Select
Range("a65536").End(xlUp).Select
Selection.Copy
Sheets("ANALYSE").Select
Range("C15").Select
ActiveSheet.Paste
Range("C15").Font.Bold = True
Range("C15").HorizontalAlignment = xlCenter
Range("C15").VerticalAlignment = xlCenter
ActiveSheet.Protect "1234", True, True, True
Sheets("sauvegarde").Select
ActiveSheet.Protect "1234", True, True, True
Sheets("ANALYSE").Select
Range("C15").Select
End With
Unload Me
End Sub |
Partager