Sub mepfff()
'
' mepfff Macro
'

'
    Range("C1").Select
    Selection.ClearContents
    Columns("B:B").Select
    Selection.Cut Destination:=Columns("C:C")
    Columns("E:E").Select
    Selection.Cut Destination:=Columns("B:B")
    Columns("B:B").Select
    Columns("B:B").EntireColumn.AutoFit
    Columns("D:D").Select
    Selection.Delete shift:=xlToLeft
    Range("E1").Select
    Selection.Cut Destination:=Range("D1")
    Columns("F:F").Select
    Selection.Cut Destination:=Columns("E:E")
    Columns("G:G").Select
    Selection.Cut Destination:=Columns("F:F")
    Range("H1").Select
    Selection.Cut Destination:=Range("G1")
    Columns("J:J").Select
    Selection.Cut Destination:=Columns("H:H")
    Range("I1").Select
    Selection.ClearContents
    Range("K2").Select
    Selection.Cut Destination:=Range("I1")
    Range("K1").Select
    Selection.Cut Destination:=Range("I1")
    Range("L1").Select
    Selection.Cut Destination:=Range("J1")
    Range("K1").Select
    With Selection.Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .ColorIndex = 15
        .TintAndShade = 0
        .PatternTintAndShade = 0
    End With
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    Selection.Borders(xlEdgeTop).LineStyle = xlNone
    Selection.Borders(xlEdgeBottom).LineStyle = xlNone
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    Selection.Borders(xlInsideVertical).LineStyle = xlNone
    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
    ActiveCell.FormulaR1C1 = "Diamètre"
    Range("H2").Select
    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlDown)).Select
    Columns("H:H").Select
    Selection.Copy
    Range("K1").Select
    Application.CutCopyMode = False
    Selection.ClearContents
    Columns("H:H").Select
    Selection.Copy
    Range("K1").Select
    ActiveSheet.Paste
    Range("L7").Select
    Application.CutCopyMode = False
    Range("K1").Select
    ActiveCell.FormulaR1C1 = "Diamètre"
    Range("M1").Select
    Selection.Cut Destination:=Range("L1")
    Range("L1").Select
    ActiveWindow.SmallScroll Down:=3
    ActiveWindow.ScrollColumn = 2
    ActiveWindow.ScrollColumn = 3
    ActiveWindow.ScrollColumn = 4
    ActiveWindow.ScrollColumn = 5
    ActiveWindow.ScrollColumn = 6
    ActiveWindow.SmallScroll Down:=-39
    Columns("N:N").Select
    Selection.Delete shift:=xlToLeft
    Selection.Delete shift:=xlToLeft
    Columns("R:R").Select
    Selection.Delete shift:=xlToLeft
    Selection.Delete shift:=xlToLeft
    Columns("Q:Q").Select
    Selection.Delete shift:=xlToLeft
    Columns("P:P").Select
    Selection.Delete shift:=xlToLeft
    Columns("R:R").Select
    Selection.Delete shift:=xlToLeft
    Columns("S:S").Select
    Selection.Delete shift:=xlToLeft
    Columns("R:R").Select
    Selection.Delete shift:=xlToLeft
    Columns("Q:Q").Select
    Selection.Delete shift:=xlToLeft
    Columns("O:O").Select
    Selection.Delete shift:=xlToLeft
    Columns("N:N").Select
    Selection.Delete shift:=xlToLeft
    Columns("R:R").Select
    Selection.Delete shift:=xlToLeft
    Selection.Delete shift:=xlToLeft
    Columns("Q:Q").Select
    Selection.Delete shift:=xlToLeft
    Range("M1").Select
    With Selection.Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .ColorIndex = 15
        .TintAndShade = 0
        .PatternTintAndShade = 0
    End With
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    Selection.Borders(xlEdgeTop).LineStyle = xlNone
    Selection.Borders(xlEdgeBottom).LineStyle = xlNone
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    Selection.Borders(xlInsideVertical).LineStyle = xlNone
    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
    ActiveCell.FormulaR1C1 = "fff"
    Range("M3").Select


'
' Macro1 Macro
'

'
        Columns("C:D").Select
    Selection.Delete shift:=xlToLeft
    Columns("E:H").Select
    Selection.Delete shift:=xlToLeft
    Columns("F:J").Select
    Selection.Delete shift:=xlToLeft
    Columns("E:E").Select
    Selection.Cut
    Columns("D:D").Select
    Selection.Insert shift:=xlToRight
    Range("G1").Select
    ActiveCell.FormulaR1C1 = "1.1"
    Range("F2").Select
    ActiveCell.FormulaR1C1 = "=IF(RC[-1]="""","""",ROUNDUP(RC[-1]*R1C7,0))"
    Range("F2").Select
    Selection.AutoFill Destination:=Range("F2:F1244"), Type:=xlFillDefault
    Range("F2:F1244").Select
    ActiveWindow.SmallScroll Down:=-78

  
  Range("F1").Select
    ActiveCell.FormulaR1C1 = "Majoration"
    Range("F1").Select
    With Selection.Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .ThemeColor = xlThemeColorDark1
        .TintAndShade = -0.249977111117893
        .PatternTintAndShade = 0
    End With
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    
     Columns("C:C").Select
    ActiveWorkbook.Worksheets("feuil2").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("feuil2").Sort.SortFields.Add Key:=Range("C1") _
        , SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("feuil2").Sort
        .SetRange Range("A2:G1244")
        .Header = xlNo
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
    
    For i = Cells(Rows.Count, 4).End(xlUp).Row To 2 Step -1
        If Cells(i, 4) = Cells(i - 1, 4) Then
            Cells(i - 1, "E") = Cells(i - 1, "E") + Cells(i, "e")
            Rows(i).Delete shift:=xlUp
        End If
    Next i
    
    Columns("B:B").Select
    ActiveWorkbook.Worksheets("feuil2").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("feuil2").Sort.SortFields.Add Key:=Range("B1")
        
    With ActiveWorkbook.Worksheets("feuil2").Sort
        .SetRange Range("A2:G1216")
        .Header = xlNo
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With


' trillagechauff Macro
'

'
    Columns("F:F").Select
    Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
    Range("F1").Select
    ActiveCell.FormulaR1C1 = "L(m)"
    Range("E1").Select
    ActiveCell.FormulaR1C1 = "L(mm)"
    Range("F2").Select
    ActiveCell.FormulaR1C1 = "=RC[-1]/1000"
    Range("F2").Select
    Selection.AutoFill Destination:=Range("F2:F943")
    Range("F2:F943").Select
    Range("G2").Select
    ActiveCell.FormulaR1C1 = "=IF(RC[-2]="""","""",ROUNDUP(RC[-2]*R1C8,0))/1000"
    Range("G2").Select
    Selection.AutoFill Destination:=Range("G2:G943")
    Range("G2:G943").Select
    Columns("E:E").Select
    Selection.EntireColumn.Hidden = True
    Cells.Select
    Range("E1").Activate
    Selection.AutoFilter
    ActiveSheet.Range("$A$1:$AG$1245").AutoFilter Field:=3, Criteria1:="<>"
    Range("F29:F33").Select
    Selection.NumberFormat = "0.00"
    Selection.NumberFormat = "0.0"
    Selection.NumberFormat = "0.00"
    Range("G29:G33").Select
    Selection.NumberFormat = "0.0000"
    Selection.NumberFormat = "0.000"
    Selection.NumberFormat = "0.00"
    Selection.NumberFormat = "0.0"
    Selection.NumberFormat = "0.00"
    Range("G1252").Select
End Sub


