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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
| 'Attention les deux lignes suivantes doivent être impérativement placées en tout début de programme
Option Explicit
Dim Ws As Worksheet 'Variable pour un Objet Worksheet en PUBLIC pour tous les Controls de cet UserForm
'Correspond au programme du bouton QUITTER
Private Sub CommandButton2_Click()
Unload Me ' Vide et ferme l'Userform ( formulaire)
End Sub
'Correspond au programme du bouton NOUVELLE COMMANDE
Private Sub CommandButton4_Click()
Unload Me ' Vide et ferme l'Userform ( formulaire)
FORMULAIRE.Show 'Affiche le formulaire
End Sub
' CORRESPOND AU TRANFERT DE DONNEES SUR FEUILLE SUIVI BOOKING CLIENT ET SUIVI PLANIFICATION ROUTE
Private Sub CommandButton3_Click()
Dim L As Integer
If MsgBox("Etes-vous certain de vouloir INSERER ce nouveau booking ?", vbYesNo, "Demande de confirmation") = vbYes Then 'condition : si oui au message
With Worksheets("SUIVI booking client")
L = .Range("a65536").End(xlUp).Row + 1 'Permet de se positionner sur la dernière ligne de tableau NON VIDE
.Range("A" & L).Value = TextBox32
.Range("B" & L).Value = ComboBox7 'Insère la donnée de la liste déroulante dans la colonne B
.Range("C" & L).Value = TextBox1 'Insère la donnée de la textbox1 dans la colonne C
'et à suivre....
.Range("D" & L).Value = ComboBox1
.Range("E" & L).Value = TextBox2
.Range("F" & L).Value = TextBox3
.Range("G" & L).Value = TextBox4
.Range("H" & L).Value = TextBox5
.Range("I" & L).Value = TextBox6
.Range("J" & L).Value = TextBox37
.Range("K" & L).Value = ComboBox2
.Range("L" & L).Value = TextBox7
.Range("M" & L).Value = TextBox8
.Range("N" & L).Value = ComboBox5
.Range("O" & L).Value = TextBox35
.Range("P" & L).Value = TextBox36
.Range("Q" & L).Value = TextBox10
.Range("R" & L).Value = TextBox11
.Range("S" & L).Value = TextBox12
.Range("T" & L).Value = TextBox28
.Range("U" & L).Value = TextBox13
.Range("V" & L).Value = TextBox14
.Range("W" & L).Value = TextBox15
.Range("X" & L).Value = TextBox16
.Range("Y" & L).Value = TextBox29
.Range("Z" & L).Value = TextBox17
.Range("AA" & L).Value = TextBox18
.Range("AB" & L).Value = ComboBox3
.Range("AC" & L).Value = TextBox33
.Range("AD" & L).Value = ComboBox4
.Range("AE" & L).Value = TextBox34
.Range("AF" & L).Value = TextBox19
.Range("AG" & L).Value = ComboBox8
.Range("AH" & L).Value = TextBox20
.Range("AI" & L).Value = TextBox30
.Range("AJ" & L).Value = TextBox21
.Range("AK" & L).Value = TextBox22
.Range("AL" & L).Value = TextBox23
.Range("AM" & L).Value = TextBox24
.Range("AN" & L).Value = TextBox25
.Range("AO" & L).Value = TextBox31
.Range("AP" & L).Value = TextBox26
.Range("AQ" & L).Value = TextBox27
End With
With Worksheets("Suivi planification route aval")
Dim P As Integer
P = .Range("a65536").End(xlUp).Row + 1
.Range("A" & P).Value = TextBox32
.Range("B" & P).Value = ComboBox7 'Insère la donnée de la liste déroulante dans la colonne B
.Range("C" & P).Value = TextBox1 'Insère la donnée de la textbox1 dans la colonne C
'et à suivre....
.Range("D" & P).Value = ComboBox1
.Range("E" & P).Value = TextBox2
.Range("F" & P).Value = TextBox3
.Range("G" & P).Value = TextBox4
.Range("H" & P).Value = TextBox5
.Range("I" & P).Value = TextBox6
.Range("J" & P).Value = TextBox37
.Range("K" & P).Value = ComboBox2
.Range("L" & P).Value = TextBox7
.Range("M" & P).Value = TextBox8
.Range("N" & P).Value = ComboBox5
.Range("O" & P).Value = TextBox35
.Range("P" & P).Value = TextBox36
.Range("Q" & P).Value = ComboBox3
.Range("R" & P).Value = TextBox33
.Range("S" & P).Value = ComboBox4
.Range("T" & P).Value = TextBox34
.Range("U" & P).Value = TextBox19
.Range("V" & P).Value = ComboBox8
.Range("W" & P).Value = TextBox20
.Range("X" & P).Value = TextBox30
.Range("Y" & P).Value = TextBox21
.Range("Z" & P).Value = TextBox22
.Range("AA" & P).Value = TextBox23
.Range("AB" & P).Value = TextBox24
.Range("AC" & P).Value = TextBox25
.Range("AD" & P).Value = TextBox31
.Range("AE" & P).Value = TextBox26
.Range("AF" & P).Value = TextBox27
End With
End If
'Correspond au programme du FORMULAIRE
'Cet évènement est important car il permet de définir les propriétés des objets et les valeurs par défaut des variables, lors du lancement du Userform.
Private Sub UserForm_Initialize() 'à l'initialisation de l'userform
' Déclaration des variables grâce à Dim
' 1° Choisir un nom
' 2° Choisir un TYPE (= définir la nature du contenu)
' --------------------------------------------------------
Dim J As Long 'déclare la variable J
Dim I As Integer
' DATE DU JOUR SAISIE FORMULAIRE
TextBox32.Value = Format(Date, "dd / mm / yy")
' Affecter une valeur à une variable (= fixer la valeur de la variable)
Set Ws = Sheets("SUIVI booking client")
Set Ws = Sheets("suivi planification route aval")
'Attention ce nom doit correspondre au nom de votre ONGLET
'On stock le nom de la feuille "SUIVI booking client" dans une variable nommée WS |
Partager