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
| Option Explicit
Sub compil_composants_composé()
' compile la liste des articles non option de tout les scénarios extrait et mis en forme dans
' Y:\Fichiers communs\Service Technique\Méthodes\03 - Projets et études\Projets 20\20 - PRAT - Atelier\23PRAT60-M - Etude KANBAN MIL\Analyse scénarion MH\
' Objectif : Lister les article KANBAN
Dim Fichier_dest As String, Derligne As Long, Cpt2 As Long, cle_cours As String
Dim Nomenclature_en_cours As Worksheet, Rng As Range, R01 As Long, Ligne_Nomenclature As Long
Application.Calculation = xlManual 'calcul en mode manuel
Application.ScreenUpdating = False 'ne pas mettre a jour l'ecran
Fichier_dest = "\\192.168.1.5\Fichiers communs\Service Technique\Méthodes\03 - Projets et études\Projets 20\20 - PRAT - Atelier\23PRAT60-M - Etude KANBAN MIL\Analyse scénarion MH\"
Workbooks.Open Fichier_dest & "nomenclature SE avec num OPE.xlsm"
Set Nomenclature_en_cours = ActiveWorkbook.Sheets(1)
ThisWorkbook.Activate
Derligne = Cells(Rows.Count, 1).End(xlUp).Row
With Nomenclature_en_cours.Range("C:C")
For Cpt2 = Derligne To 2 Step -1
cle_cours = Cells(Cpt2, 2).Value
Set Rng = .Find(What:=cle_cours, LookIn:=xlValues)
If Not Rng Is Nothing Then
'--- première occurrence trouvée
R01 = Rng.Row
Do
Ligne_Nomenclature = Rng.Row
Rows(Cpt2 + 1).Insert
Cells(Cpt2 + 1, 1) = Cells(Cpt2, 1)
Cells(Cpt2 + 1, 2) = Cells(Cpt2, 2)
Cells(Cpt2 + 1, 3).Value = Nomenclature_en_cours.Cells(Ligne_Nomenclature, 5)
Cells(Cpt2 + 1, 4).Value = Nomenclature_en_cours.Cells(Ligne_Nomenclature, 6)
Cells(Cpt2 + 1, 5).Value = Nomenclature_en_cours.Cells(Ligne_Nomenclature, 25)
Set Rng = .FindNext(Rng) '--- occurrence suivante trouvée
Loop Until Rng.Row = R01 '--- revenu sur la première occurence
End If
Next
End With
Set Nomenclature_en_cours = Nothing
Application.Calculation = xlAutomatic
Application.ScreenUpdating = True
End Sub |
Partager