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
|
Sub Remplissage()
Dim R_n_TWT As Integer, R_Channel As String, R_Selectivite As String, R_SSI_type As String, R_Panel As String
Dim Lettre As String, Select_panel As String, Select_panel_plus As String, Select_panel_TWT As String, Index_TWT_WC As Variant
Dim Channel As String, Selectivite As String, SSI_type As String
Dim i As Integer, i_L As Integer, i_C As Integer, IndexL As Integer
Dim R_Gain As Double
'création des tableaux ampli-canal pour les 2 panneaux
Sheets("Polar_X").Select
Range("A1:AT50").Select
Selection.Copy
Sheets.Add
ActiveSheet.Select
ActiveSheet.Name = "South_Panel"
Range("A1").Select
ActiveSheet.Paste
Sheets("Polar_Y").Select
Range("A1:AT50").Select
Selection.Copy
Sheets.Add
ActiveSheet.Select
ActiveSheet.Name = "North_Panel"
Range("A1").Select
ActiveSheet.Paste
'pour tous les SSI de "Satting_DLA"
For IndexL = 388 To 545
R_Gain = Worksheets("Satting_DLA").Cells(IndexL, "B")
R_Selectivite = Worksheets("Satting_DLA").Cells(IndexL, "D")
R_Channel = Worksheets("Satting_DLA").Cells(IndexL, "E")
R_n_TWT = Worksheets("Satting_DLA").Cells(IndexL, "F")
R_SSI_type = Worksheets("Satting_DLA").Cells(IndexL, "G")
R_Panel = Worksheets("Satting_DLA").Cells(IndexL, "I")
'selection du panneau
If R_Panel = "N" Then
Sheets("North_Panel").Activate
Select_panel = "North_Panel"
Else
Sheets("South_Panel").Activate
Select_panel = "South_Panel"
End If
'remplissage des niveaux entrées DLA nominaux
If R_SSI_type = "P0_" Then
Select_panel_plus = Select_panel & "!A3:AM3"
Index_Select = Application.Match(R_Selectivite, Range(Select_panel_plus), 0)
Selectivite = Worksheets(Select_panel).Cells(3, Index_Select)
If Selectivite = "__" Then
Select_panel_plus = Select_panel & "!A4:AM4"
Index_Select = Application.Match(R_Channel, Range(Select_panel_plus), 0)
For i_C = 8 To 44
Lettre = Worksheets(Select_panel).Cells(i_C, Index_Select)
If Lettre = "N" Then
Worksheets(Select_panel).Cells(i_C, Index_Select) = R_Gain & " (N)"
End If
Next i_C
ElseIf Selectivite = R_Selectivite Then
For i_C = 8 To 44
Lettre = Worksheets(Select_panel).Cells(i_C, Index_Select)
If Lettre = "N" Then
Worksheets(Select_panel).Cells(i_C, Index_Select) = R_Gain & " (N)"
End If
Next i_C
End If
End If
'remplissage des niveaux entrées DLA redondants
If R_SSI_type = "P1L" Then
Select_panel_plus = Select_panel & "!A3:AM3"
Index_Select = Application.Match(R_Selectivite, Range(Select_panel_plus), 0)
Selectivite = Worksheets(Select_panel).Cells(3, Index_Select)
If Selectivite = "__" Then
Select_panel_plus = Select_panel & "!A4:AM4"
Index_Select = Application.Match(R_Channel, Range(Select_panel_plus), 0)
For i_C = 8 To 44
Lettre = Worksheets(Select_panel).Cells(i_C, Index_Select)
If Lettre = "R" Then
Worksheets(Select_panel).Cells(i_C, Index_Select) = R_Gain & " (R)"
End If
Next i_C
ElseIf Selectivite = R_Selectivite Then
For i_C = 8 To 44
Lettre = Worksheets(Select_panel).Cells(i_C, Index_Select)
If Lettre = "R" Then
Worksheets(Select_panel).Cells(i_C, Index_Select) = R_Gain & " (R)"
End If
Next i_C
End If
End If
'remplissage des niveaux entrées DLA chemin worst case
If R_SSI_type = "WCL" Then
Select_panel_plus = Select_panel & "!A3:AM3"
Select_panel_TWT = Select_panel & "!A1:A44"
Index_Select = Application.Match(R_Selectivite, Range(Select_panel_plus), 0)
Index_TWT_WC = Application.Match(R_n_TWT, Range(Select_panel_TWT), 0)
Selectivite = Worksheets(Select_panel).Cells(3, Index_Select)
If Selectivite = "__" Then
Select_panel_plus = Select_panel & "!A4:AM4"
Index_Select = Application.Match(R_Channel, Range(Select_panel_plus), 0)
Lettre = Worksheets(Select_panel).Cells(Index_TWT_WC, Index_Select)
If Lettre = "X" Then
Worksheets(Select_panel).Cells(Index_TWT_WC, Index_Select) = R_Gain & " (X)"
ElseIf Lettre = "" Then
MsgBox ("Il n'y a pas de croix (X) pour le canal " & R_Channel & " et pour le tube " & R_n_TWT)
End If
ElseIf Selectivite = R_Selectivite Then
Lettre = Worksheets(Select_panel).Cells(Index_TWT_WC, Index_Select)
If Lettre = "X" Then
Worksheets(Select_panel).Cells(Index_TWT_WC, Index_Select) = R_Gain & " (X)"
ElseIf Lettre <> "X" Then
MsgBox ("Il n'y a pas de croix (X) pour le canal " & R_Channel & " et pour le tube " & R_n_TWT)
End If
End If
End If
Next IndexL
End Sub |
Partager