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
| Sub Now()
Range("A15").Select
Selection.Copy
Range("C5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("D9").Select
End Sub
Sub Trace()
Application.ScreenUpdating = False
Dim a As Double, b As Double
'Values
Sheets("Values").Select
Range("A1").Select
a = 0
While ActiveCell <> ""
ActiveCell.Offset(1, 0).Select
a = a + 1
Wend
Range("J1").Select
b = 0
While ActiveCell <> ""
ActiveCell.Offset(1, 0).Select
b = b + 1
Wend
Columns("E:H").Select
Selection.ClearContents
Columns("M:O").Select
Selection.ClearContents
Range("F1").Select
ActiveCell.FormulaR1C1 = "Energie spécifique"
Range("G1").Select
ActiveCell.FormulaR1C1 = "Ratio FL"
Range("H1").Select
ActiveCell.FormulaR1C1 = "Energie spécifique corrigée"
Range("N1").Select
ActiveCell.FormulaR1C1 = "Resistances"
Range("O1").Select
ActiveCell.FormulaR1C1 = "Target"
Range("A2:A" & a).Select
Selection.Copy
Range("E2").Select
Selection.PasteSpecial Paste:=xlPasteValues
Range("F2").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-4]<>"""",(RC[-4]-130)/((Values2!RC[7])*Values3!RC/100),NA())"
Selection.AutoFill Destination:=Range("F2:F" & a), Type:=xlFillDefault
Range("G2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-4]<>"""",RC[-4],NA())"
Selection.AutoFill Destination:=Range("G2:G" & a), Type:=xlFillDefault
Range("H2").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-6]<>"""",(RC[-6]-130)/((Values2!RC[3])*Values3!RC[-2]/100),NA())"
Selection.AutoFill Destination:=Range("H2:H" & a), Type:=xlFillDefault
Range("J2:J" & b).Select
Selection.Copy
Range("M2").Select
Selection.PasteSpecial Paste:=xlPasteValues
Range("N2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-3]<>"""",RC[-3],NA())"
Selection.AutoFill Destination:=Range("N2:N" & b), Type:=xlFillDefault
Range("O2").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-2]<>"""",IF(Commandes!R5C4=Commandes!R1C10,900,IF(Commandes!R5C4=Commandes!R1C11,850,NA())),NA())"
Selection.AutoFill Destination:=Range("O2:O" & b), Type:=xlFillDefault
'Values2
Sheets("Values2").Select
Columns("H:M").Select
Selection.ClearContents
Range("H1").Select
ActiveCell.FormulaR1C1 = "Débit vers CMA"
Range("I1").Select
ActiveCell.FormulaR1C1 = "Débit vers CMC"
Range("J1").Select
ActiveCell.FormulaR1C1 = "Débit vers CMY"
Range("K1").Select
ActiveCell.FormulaR1C1 = "Débit tot vers CM"
Range("L1").Select
ActiveCell.FormulaR1C1 = "Débit recirculation"
Range("M1").Select
ActiveCell.FormulaR1C1 = "Débit total Raffineur"
Range("G2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-6]<>"""",RC[-6],NA())"
Selection.AutoFill Destination:=Range("G2:G" & a), Type:=xlFillDefault
Range("H2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-6]<>"""",RC[-6],NA())"
Selection.AutoFill Destination:=Range("H2:H" & a), Type:=xlFillDefault
Range("I2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-5]<>"""",RC[-5],NA())"
Selection.AutoFill Destination:=Range("I2:I" & a), Type:=xlFillDefault
Range("J2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-5]<>"""",RC[-5],NA())"
Selection.AutoFill Destination:=Range("J2:J" & a), Type:=xlFillDefault
Range("K2").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-3]:RC[-1])"
Selection.AutoFill Destination:=Range("K2:K" & a), Type:=xlFillDefault
Range("L2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-9]<>"""",RC[-9],NA())"
Selection.AutoFill Destination:=Range("L2:L" & a), Type:=xlFillDefault
Range("M2").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-2]:RC[-1])"
Selection.AutoFill Destination:=Range("M2:M" & a), Type:=xlFillDefault
'Values3
Sheets("Values3").Select
Columns("E:G").Select
Selection.ClearContents
Range("F1").Select
ActiveCell.FormulaR1C1 = "Conc. entrée Raff"
Range("G1").Select
ActiveCell.FormulaR1C1 = "Pression entrée Raff"
Range("E2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-4]<>"""",RC[-4],NA())"
Selection.AutoFill Destination:=Range("E2:E" & a), Type:=xlFillDefault
Range("F2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-4]<>"""",RC[-4],NA())"
Selection.AutoFill Destination:=Range("F2:F" & a), Type:=xlFillDefault
Range("G2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-4]<>"""",RC[-4],NA())"
Selection.AutoFill Destination:=Range("G2:G" & a), Type:=xlFillDefault
'Values4
Sheets("Values4").Select
Columns("E:F").Select
Selection.ClearContents
Range("F1").Select
ActiveCell.FormulaR1C1 = "Niveau cuvier stock FL"
Range("E2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-4]<>"""",RC[-4],NA())"
Selection.AutoFill Destination:=Range("E2:E" & a), Type:=xlFillDefault
Range("F2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-4]<>"""",RC[-4],NA())"
Selection.AutoFill Destination:=Range("F2:F" & a), Type:=xlFillDefault
Call Chart(a, b)
Call Chart2(a, b)
Call Chart3(a, b)
Call Chart4(a, b)
Call rangement
Application.ScreenUpdating = True
End Sub |
Partager