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 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489
| Private Sub CommandButton1_Click()
Dim ArtExiste As Integer
ArtRech = UCase(RechercheArticle)
' Affichage des données de la page ARTICLES
Windows("Revue Referentiel.xls").Activate
Sheets("REF").Select
Nligne = Cells(1, 1).CurrentRegion.Rows.Count
ArtExiste = 0
For x = 1 To Nligne
If Cells(x, 2) = ArtRech Then
ArtExiste = 1
Principal.MultiPage1.Value = 1
LibelleCourt = Cells(x, 3)
LibelleLong = Cells(x, 4)
Statut = Cells(x, 10)
Pump = Cells(x, 7)
TypeArt = Cells(x, 5)
Org = Cells(x, 1)
FeuilCatalogue = Cells(x, 26)
CycleProd = Cells(x, 28)
CycleAchat = Cells(x, 36)
LieuRep = Cells(x, 32)
DescriptRep = Cells(x, 33)
RMARep = Cells(x, 34)
DelaiRep = Cells(x, 35)
Criticite = Cells(x, 31)
Dedie = Cells(x, 44)
HorsNorme = Cells(x, 45)
ComAchats = Cells(x, 50)
ComLog = Cells(x, 51)
ComMaint = Cells(x, 52)
ComRep = Cells(x, 53)
ComTech = Cells(x, 54)
PointCde = Cells(x, 24)
If Left(Cells(x, 3), 4) = "INPT" Then
Dotation = Cells(x, 25)
Else
QteACder = Cells(x, 25)
End If
SpecCde = Cells(x, 63)
StockSecu = Cells(x, 9)
DateCreation = Cells(x, 20)
Demandeur = Cells(x, 37)
Windows("Liste_Responsables_Equipements_V30.xls").Activate
NligneRE = Cells(1, 1).CurrentRegion.Rows.Count
For Z = 2 To NligneRE
If FeuilCatalogue = Cells(Z, 9) Then
Resp_Equip = Cells(Z, 13)
End If
Next Z
Windows("Revue Referentiel.xls").Activate
Sheets("REF").Select
Acheteur = Cells(x, 74)
DateModif = Cells(x, 22)
AuteurModif = Cells(x, 23)
DelaiAppro = Cells(x, 57)
Documentation = Cells(x, 62)
InitialisationStock = Cells(x, 64)
ArticlePere = ArtRech
Select Case Cells(x, 14)
Case Is = "OUI": MvtsAuto.Value = True
Case Is = "NON": MvtsAuto.Value = False
End Select
Select Case Cells(x, 11)
Case Is = "OUI": StockAuto.Value = True
Case Is = "NON": StockAuto.Value = False
End Select
Select Case Cells(x, 12)
Case Is = "OUI": AchatAuto.Value = True
Case Is = "NON": AchatAuto.Value = False
End Select
Select Case Cells(x, 13)
Case Is = "OUI": FactAuto.Value = True
Case Is = "NON": FactAuto.Value = False
End Select
Select Case Cells(x, 17)
Case Is = "OUI": LotAuto.Value = True
Case Is = "NON": LotAuto.Value = False
End Select
Select Case Cells(x, 15)
Case Is = "OUI": SerieAuto.Value = True
Case Is = "NON": SerieAuto.Value = False
End Select
Select Case Cells(x, 16)
Case Is = "OUI": VersAuto.Value = True
Case Is = "NON": VersAuto.Value = False
End Select
End If
Next x
' Affichage des données de la page NOMENCLATURES
Windows("Revue Referentiel.xls").Activate
Sheets("Nomenclature Equipement").Select
Nligne = Cells(1, 1).CurrentRegion.Rows.Count
Z = 0
For x = 1 To Nligne
If Cells(x, 1) = ArtRech Then
Z = Z + 1
Select Case Z
Case Is = 1
NomE11 = Cells(x, 2)
NomE12 = Cells(x, 3)
NomE13 = Cells(x, 4)
NomE14 = Cells(x, 5)
Case Is = 2
NomE21 = Cells(x, 2)
NomE22 = Cells(x, 3)
NomE23 = Cells(x, 4)
NomE24 = Cells(x, 5)
Case Is = 3
NomE31 = Cells(x, 2)
NomE32 = Cells(x, 3)
NomE33 = Cells(x, 4)
NomE34 = Cells(x, 5)
Case Is = 4
NomE41 = Cells(x, 2)
NomE42 = Cells(x, 3)
NomE43 = Cells(x, 4)
NomE44 = Cells(x, 5)
Case Is = 5
NomE51 = Cells(x, 2)
NomE52 = Cells(x, 3)
NomE53 = Cells(x, 4)
NomE54 = Cells(x, 5)
Case Is = 6
NomE61 = Cells(x, 2)
NomE62 = Cells(x, 3)
NomE63 = Cells(x, 4)
NomE64 = Cells(x, 5)
Case Is = 7
NomE71 = Cells(x, 2)
NomE72 = Cells(x, 3)
NomE73 = Cells(x, 4)
NomE74 = Cells(x, 5)
Case Is = 8
NomE81 = Cells(x, 2)
NomE82 = Cells(x, 3)
NomE83 = Cells(x, 4)
NomE84 = Cells(x, 5)
End Select
End If
Next x
' Affichage des données de la page PANNE ANNEE MOIS
Windows("Revue Referentiel.xls").Activate
Sheets("Pannes_Année Glissante").Select
Nligne = Cells(1, 1).CurrentRegion.Rows.Count
AnMois1 = Cells(1, 2)
AnMois2 = Cells(1, 3)
AnMois3 = Cells(1, 4)
AnMois4 = Cells(1, 5)
AnMois5 = Cells(1, 6)
AnMois6 = Cells(1, 7)
AnMois7 = Cells(1, 8)
AnMois8 = Cells(1, 9)
AnMois9 = Cells(1, 10)
AnMois10 = Cells(1, 11)
AnMois11 = Cells(1, 12)
AnMois12 = Cells(1, 13)
AnMois13 = Cells(1, 14)
For x = 1 To Nligne
If Cells(x, 1) = ArtRech Then
PanneAnMois1 = Cells(x, 2)
PanneAnMois2 = Cells(x, 3)
PanneAnMois3 = Cells(x, 4)
PanneAnMois4 = Cells(x, 5)
PanneAnMois5 = Cells(x, 6)
PanneAnMois6 = Cells(x, 7)
PanneAnMois7 = Cells(x, 8)
PanneAnMois8 = Cells(x, 9)
PanneAnMois9 = Cells(x, 10)
PanneAnMois10 = Cells(x, 11)
PanneAnMois11 = Cells(x, 12)
PanneAnMois12 = Cells(x, 13)
PanneAnMois13 = Cells(x, 14)
TotalPanneAnMois = Cells(x, 15)
End If
Next x
' Affichage des données de la page PANNE ANNEE
Windows("Revue Referentiel.xls").Activate
Sheets("PannesParAnnées").Select
Nligne = Cells(1, 1).CurrentRegion.Rows.Count
'
An1 = Cells(1, 2)
An2 = Cells(1, 3)
An3 = Cells(1, 4)
An4 = Cells(1, 5)
An5 = Cells(1, 6)
An6 = Cells(1, 7)
An7 = Cells(1, 8)
An8 = Cells(1, 9)
An9 = Cells(1, 10)
For x = 1 To Nligne
If Cells(x, 1) = ArtRech Then
PanneAn1 = Cells(x, 2)
PanneAn2 = Cells(x, 3)
PanneAn3 = Cells(x, 4)
PanneAn4 = Cells(x, 5)
PanneAn5 = Cells(x, 6)
PanneAn6 = Cells(x, 7)
PanneAn7 = Cells(x, 8)
panneAn8 = Cells(x, 9)
PanneAn9 = Cells(x, 10)
TotalPanneAn = Cells(x, 11)
End If
Next x
'
'
' Affichage nomenclature equipement
Dim MyArray(30, 5)
Dim i As Single
ListBox1.ColumnCount = 5
Windows("Revue Referentiel.xls").Activate
Sheets("Nomenclature Equipement").Select
Nligne = Cells(1, 1).CurrentRegion.Rows.Count
Z = 0
MyArray(0, 1) = "Fonctionnalité"
MyArray(0, 2) = "Article Fils"
MyArray(0, 3) = "Description"
MyArray(0, 4) = "Quantité"
For x = 1 To Nligne
If Cells(x, 1) = ArtRech Then
Z = Z + 1
MyArray(Z, 1) = Cells(x, 2)
MyArray(Z, 2) = Cells(x, 3)
MyArray(Z, 3) = Cells(x, 4)
MyArray(Z, 4) = Cells(x, 5)
End If
Next x
ListBox1.List() = MyArray
ListBox1.ColumnWidths = "40;100;70;250;40" ' largeur des colonnes
'
' Affichage Equivalence
Dim MyArrayEquiv(20, 7)
'Dim param As String
ListBox2.ColumnCount = 7
Windows("Revue Referentiel.xls").Activate
Sheets("Relation").Select
Nligne = Cells(1, 1).CurrentRegion.Rows.Count
Z = 0
MyArrayEquiv(0, 1) = "Article relation"
MyArrayEquiv(0, 2) = "Type relation"
MyArrayEquiv(0, 3) = "Rang"
MyArrayEquiv(0, 4) = "Réciprocité relation"
MyArrayEquiv(0, 5) = "Date début"
MyArrayEquiv(0, 6) = "Date fin relation"
MyArrayEquiv(0, 7) = "Planifaiction activée"
For x = 1 To Nligne
If Cells(x, 1) = ArtRech Then
Z = Z + 1
MyArrayEquiv(Z, 1) = Cells(x, 3)
MyArrayEquiv(Z, 2) = Cells(x, 4)
MyArrayEquiv(Z, 3) = Cells(x, 9)
MyArrayEquiv(Z, 4) = Cells(x, 5)
MyArrayEquiv(Z, 5) = Cells(x, 6)
MyArrayEquiv(Z, 6) = Cells(x, 7)
MyArrayEquiv(Z, 7) = Cells(x, 8)
ArtRelation = Cells(x, 1)
ArtDescriptRelation = Cells(x, 2)
End If
Next x
ListBox2.List() = MyArrayEquiv
ListBox2.ColumnWidths = "40;70;150;40;100;100;100" ' largeur des colonnes
' Affichage Référence Fabricant
Dim MyArrayRefFab(30, 5)
ListBox3.ColumnCount = 5
Windows("Revue Referentiel.xls").Activate
Sheets("Ref Fabricant").Select
Nligne = Cells(1, 1).CurrentRegion.Rows.Count
Z = 0
MyArrayRefFab(0, 1) = "Nom fabricant"
MyArrayRefFab(0, 2) = "Description fabricant"
MyArrayRefFab(0, 3) = "Référence fabricant"
MyArrayRefFab(0, 4) = "Date modification fabricant"
For x = 1 To Nligne
If Cells(x, 1) = ArtRech Then
Z = Z + 1
MyArrayRefFab(Z, 1) = Cells(x, 3)
MyArrayRefFab(Z, 2) = Cells(x, 4)
MyArrayRefFab(Z, 3) = Cells(x, 6)
MyArrayRefFab(Z, 4) = Cells(x, 7)
'MyArrayRefFab(Z, 5) = Cells(x, 7)
End If
Next x
ListBox3.List() = MyArrayRefFab
ListBox3.ColumnWidths = "10;150;300;150;40" ' largeur des colonnes
' Affichage nomenclature RCS
Dim MyArrayRCS(40, 6)
ListBox4.ColumnCount = 6
Windows("Revue Referentiel.xls").Activate
Sheets("Nomenclature RCS").Select
Nligne = Cells(1, 1).CurrentRegion.Rows.Count
Z = 0
MyArrayRCS(0, 1) = "Article rechange"
MyArrayRCS(0, 2) = "Description"
MyArrayRCS(0, 3) = "Criticité"
MyArrayRCS(0, 4) = "Quantité rechange"
MyArrayRCS(0, 5) = "Gamme RCS"
For x = 1 To Nligne
If Cells(x, 1) = ArtRech Then
Z = Z + 1
MyArrayRCS(Z, 1) = Cells(x, 2)
MyArrayRCS(Z, 2) = Cells(x, 3)
MyArrayRCS(Z, 3) = Cells(x, 4)
MyArrayRCS(Z, 4) = Cells(x, 5)
MyArrayRCS(Z, 5) = Cells(x, 6)
End If
Next x
ListBox4.List() = MyArrayRCS
ListBox4.ColumnWidths = "10;70;350;70;80;200" ' largeur des colonnes
'
' Affichage Paramétrage
Dim MyArrayParam(70, 5)
ListBox5.ColumnCount = 6
Windows("Revue Referentiel.xls").Activate
Sheets("Param").Select
Nligne = Cells(1, 1).CurrentRegion.Rows.Count
Z = 0
MyArrayParam(0, 1) = "Type Dépôt"
MyArrayParam(0, 2) = "Magasins"
MyArrayParam(0, 3) = "Date paramétrage"
MyArrayParam(0, 4) = "Quantité minimum"
MyArrayParam(0, 5) = "Quantité maximum"
For x = 1 To Nligne
If Cells(x, 1) = ArtRech Then
Z = Z + 1
MyArrayParam(Z, 1) = Cells(x, 4)
MyArrayParam(Z, 2) = Cells(x, 3)
MyArrayParam(Z, 3) = Cells(x, 8)
MyArrayParam(Z, 4) = Cells(x, 10)
MyArrayParam(Z, 5) = Cells(x, 9)
End If
Next x
ListBox5.List() = MyArrayParam
ListBox5.ColumnWidths = "10;80;80;100;80;80" ' largeur des colonnes
ListBox5.TextAlign = fmTextAlignCenter
' Affichage DA sans cde
Dim MyArrayDAsansCde(10, 6)
ListBox7.ColumnCount = 7
Windows("Revue Referentiel.xls").Activate
Sheets("DAsansCde").Select
Nligne = Cells(1, 1).CurrentRegion.Rows.Count
Z = 0
MyArrayDAsansCde(0, 1) = "N° DA"
MyArrayDAsansCde(0, 2) = "Description DA"
MyArrayDAsansCde(0, 3) = "Date création DA"
MyArrayDAsansCde(0, 4) = "Prescripteur"
MyArrayDAsansCde(0, 5) = "Quantité demandée"
MyArrayDAsansCde(0, 6) = "Projet"
For x = 1 To Nligne
If Cells(x, 1) = ArtRech Then
Z = Z + 1
MyArrayDAsansCde(Z, 1) = Cells(x, 3)
MyArrayDAsansCde(Z, 2) = Cells(x, 4)
MyArrayDAsansCde(Z, 3) = Cells(x, 6)
MyArrayDAsansCde(Z, 4) = Cells(x, 5)
MyArrayDAsansCde(Z, 5) = Cells(x, 8)
MyArrayDAsansCde(Z, 6) = Cells(x, 9)
End If
Next x
ListBox7.List() = MyArrayDAsansCde
ListBox7.ColumnWidths = "5;50;280;100;100;80;80" ' largeur des colonnes
'ListBox7.TextAlign = fmTextAlignCenter
' Affichage Commande non livrée
Dim MyArrayCdeNonLivree(10, 5)
ListBox6.ColumnCount = 6
Windows("Revue Referentiel.xls").Activate
Sheets("Commande").Select
Nligne = Cells(1, 1).CurrentRegion.Rows.Count
Z = 0
MyArrayCdeNonLivree(0, 1) = "N° Cde"
MyArrayCdeNonLivree(0, 2) = "Date création Cde"
MyArrayCdeNonLivree(0, 3) = "Projet"
MyArrayCdeNonLivree(0, 4) = "Quantité non livrée"
MyArrayCdeNonLivree(0, 5) = "Prescripteur"
For x = 1 To Nligne
If Cells(x, 1) = ArtRech And Cells(x, 11) <> 0 Then
Z = Z + 1
MyArrayCdeNonLivree(Z, 1) = Cells(x, 3)
MyArrayCdeNonLivree(Z, 2) = Cells(x, 5)
MyArrayCdeNonLivree(Z, 3) = Cells(x, 6)
MyArrayCdeNonLivree(Z, 4) = Cells(x, 11)
MyArrayCdeNonLivree(Z, 5) = Cells(x, 12)
End If
Next x
ListBox6.List() = MyArrayCdeNonLivree
ListBox6.ColumnWidths = "5;50;100;100;100;100" ' largeur des colonnes
'ListBox7.TextAlign = fmTextAlignCenter
' Affichage Stock
Dim MyArrayStockM(1000, 4)
Dim MyArrayStockD(1000, 4)
ListBox9.ColumnCount = 5
ListBox8.ColumnCount = 5
Windows("Stock.xls").Activate
Sheets("Stock_Mag").Select
Nligne = Cells(1, 1).CurrentRegion.Rows.Count
Z = 0
w = 0
MyArrayStockM(0, 1) = "Type Dépôt"
MyArrayStockM(0, 2) = "Magasin"
MyArrayStockM(0, 3) = "Lieu"
MyArrayStockM(0, 4) = "Quantité"
MyArrayStockD(0, 1) = "Type Dépôt"
MyArrayStockD(0, 2) = "Magasin"
MyArrayStockD(0, 3) = "Lieu"
MyArrayStockD(0, 4) = "Quantité"
For x = 1 To Nligne
If Cells(x, 1) = ArtRech And Left(Cells(x, 3), 1) = "M" Then
Z = Z + 1
MyArrayStockM(Z, 1) = Cells(x, 2)
MyArrayStockM(Z, 2) = Cells(x, 3)
MyArrayStockM(Z, 3) = Cells(x, 4)
MyArrayStockM(Z, 4) = Cells(x, 5)
End If
If Cells(x, 1) = ArtRech And Left(Cells(x, 3), 1) = "D" Then
w = w + 1
MyArrayStockD(w, 1) = Cells(x, 2)
MyArrayStockD(w, 2) = Cells(x, 3)
MyArrayStockD(w, 3) = Cells(x, 4)
MyArrayStockD(w, 4) = Cells(x, 5)
End If
If Cells(x, 1) = ArtRech And Left(Cells(x, 3), 1) <> "M" And Left(Cells(x, 3), 1) <> "D" Then
Z = Z + 1
MyArrayStockM(Z, 1) = Cells(x, 2)
MyArrayStockM(Z, 2) = Cells(x, 3)
MyArrayStockM(Z, 3) = Cells(x, 4)
MyArrayStockM(Z, 4) = Cells(x, 5)
End If
Next x
ListBox8.List() = MyArrayStockM
ListBox8.ColumnWidths = "5;80;100;100;80" ' largeur des colonnes
ListBox9.List() = MyArrayStockD
ListBox9.ColumnWidths = "5;80;100;100;80" ' largeur des colonnes
'ListBox8.TextAlign = fmTextAlignCenter
If ArtExiste = 0 Then
resp = MsgBox("Code article non trouvé !", vbCritical, "Erreur de saisie")
End If
End Sub |
Partager