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 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
| Private Sub CommandButton1_Click()
' rempli la feuille stock
Worksheets("Stock").Activate
If TextBox1 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox1.Value
End If
Worksheets(Label2.Caption).Activate
If TextBox2 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox2.Value
End If
Worksheets(Label3.Caption).Activate
If TextBox3 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox3.Value
End If
Worksheets(Label4.Caption).Activate
If TextBox4 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox4.Value
End If
Worksheets(Label5.Caption).Activate
If TextBox5 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox5.Value
End If
Worksheets(Label6.Caption).Activate
If TextBox6 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox6.Value
End If
Worksheets(Label7.Caption).Activate
If TextBox7 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox7.Value
End If
Worksheets(Label8.Caption).Activate
If TextBox8 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox8.Value
End If
Worksheets(Label9.Caption).Activate
If TextBox9 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox9.Value
End If
Worksheets(Label10.Caption).Activate
If TextBox10 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox10.Value
End If
Worksheets(Label11.Caption).Activate
If TextBox11 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox11.Value
End If
Worksheets(Label12.Caption).Activate
If TextBox12 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox12.Value
End If
Worksheets(Label13.Caption).Activate
If TextBox13 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox13.Value
End If
Worksheets(Label14.Caption).Activate
If TextBox14 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox14.Value
End If
Worksheets(Label15.Caption).Activate
If TextBox15 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox15.Value
End If
Worksheets(Label16.Caption).Activate
If TextBox16 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox16.Value
End If
Worksheets(Label17.Caption).Activate
If TextBox17 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox17.Value
End If
Worksheets(Label18.Caption).Activate
If TextBox18 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox18.Value
End If
Worksheets(Label19.Caption).Activate
If TextBox19 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox19.Value
End If
Worksheets(Label20.Caption).Activate
If TextBox20 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox20.Value
End If
Worksheets(Label21.Caption).Activate
If TextBox21 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox21.Value
End If
Worksheets(Label22.Caption).Activate
If TextBox22 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox22.Value
End If
Worksheets(Label23.Caption).Activate
If TextBox23 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox23.Value
End If
Worksheets(Label24.Caption).Activate
If TextBox24 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox24.Value
End If
Worksheets(Label25.Caption).Activate
If TextBox25 = "" Then
Else
Range("C10").Select
ActiveCell.Value = ActiveCell.Value - TextBox25.Value
End If
'Rempli le compte client
Worksheets("Conso").Activate
Range("A5").Select
Nom = TB_Nom.Value
Columns(1).Find(Nom, , , , , Previous).Select
ActiveCell.Offset(0, 1).Select
'Si les dettes sont réglé, remet les compte à zéro
If OB_Dette.Value = False Then
Else
ActiveCell = TB_Dette.Value
End If
'Ajoute les consommations
If TextBox1 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox1 * 1)
End If
If TextBox2 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox2 * 1)
End If
If TextBox3 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox3 * 1)
End If
If TextBox4 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox4 * 1)
End If
If TextBox5 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox5 * 1)
End If
If TextBox6 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox6 * 1)
End If
If TextBox7 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox7 * 1)
End If
If TextBox8 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox8 * 1)
End If
If TextBox9 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox9 * 1)
End If
If TextBox10 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox10 * 1)
End If
If TextBox11 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox11 * 1)
End If
If TextBox12 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox12 * 1)
End If
If TextBox13 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox13 * 1)
End If
If TextBox14 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox14 * 1)
End If
If TextBox15 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox15 * 1)
End If
If TextBox16 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox16 * 1)
End If
If TextBox17 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox17 * 1)
End If
If TextBox18 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox18 * 1)
End If
If TextBox19 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox19 * 1)
End If
If TextBox20 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox20 * 1)
End If
If TextBox21 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox21 * 1)
End If
If TextBox22 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox22 * 1)
End If
If TextBox23 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox23 * 1)
End If
If TextBox24 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox24 * 1)
End If
If TextBox25 = "" Then
Else
ActiveCell.Value = ActiveCell.Value + (TextBox25 * 1)
End If
'reinitialise l'userform
Unload CSLG
CSLG.Show
End Sub |