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
| Sub documenter_fichier_propagation()
Dim fichier_librairie As String
Dim ch_class As Variant
Dim ch_fichier_propagation() As String
Dim fichier_propagation As String
Dim A, B, X, Y As String
Dim lg, i, j As Integer
fichier_librairie = ActiveWorkbook.Name
ch_class = Application.GetOpenFilename("Fichiers Microsoft Excel, *.xls", , "Choisir le fichier de propagation", , False)
If ch_class = "" Or ch_class = False Then Exit Sub
ch_fichier_propagation() = Split(ch_class, "\")
lg = UBound(ch_fichier_propagation)
fichier_propagation = ch_fichier_propagation(lg)
Workbooks.Open fichier_propagation
i = 2
While Workbooks(fichier_propagation).Worksheets("CECILIA x VIR").Cells(i, 6) <> ""
A = Workbooks(fichier_propagation).Worksheets("CECILIA x VIR").Cells(i, 6)
j = 1
While Workbooks(fichier_librairie).Worksheets("propagation").Range("mode_degrade").Offset(j, 0) <> ""
X = Workbooks(fichier_librairie).Worksheets("propagation").Range("mode_degrade").Offset(j, 0)
Y = Workbooks(fichier_librairie).Worksheets("propagation").Range("fail_safe_mode").Offset(j, 0)
If A = X Then
B = Y
Workbooks(fichier_propagation).Worksheets("CECILIA x VIR").Cells(i, 7) = B
GoTo suite
End If
j = j + 1
Wend
suite:
i = i + 1
Wend
End Sub |
Partager