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
| Sub Macro1()
'Déclaration des variables
Dim oRng As Range
Dim i, j, t As Integer
Application.ScreenUpdating = False
Columns("AO:AQ").Select
Selection.Replace What:=".", Replacement:=",", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
'Avec "échantillon"
With Worksheets("EXTRACT")
Set oRng = .Range("AQ1")
'On boucle de i = dernière ligne non vide de la colonne 43 à 1 (décroissant)
For i = .Cells(.Cells.Rows.Count, 43).End(xlUp).Row - 1 To 1 Step -1
'Si cette valeur est < à 50000
If oRng.Offset(i, 0) < 50000 Then
'On supprime la ligne
oRng.Offset(i, 0).EntireRow.Delete
End If
Next i
End With
Columns("AR:AR").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("AR1").Select
ActiveCell.FormulaR1C1 = "PNL1"
Range("AS1").Select
ActiveCell.FormulaR1C1 = "PNL2"
Range("AR2").Select
ActiveCell.FormulaR1C1 = "=RC[-2]+RC[-3]"
Range("AR2").Select
Selection.FillDown
Range("AS2").Select
ActiveCell.FormulaR1C1 = _
"=IF(AND((RC[-1]=R[-1]C[-1]),OR((RC[-21]=""SWAP""),(RC[-21]=""EXOTIC""))),"""",RC[-1])"
Range("AS2").Select
Selection.FillDown
Application.ScreenUpdating = True
End Sub |
Partager