Re : regrouper plusieurs macro en un seul bouton
voici mes macros
j'ai rajouté la focntion mais ca ne fonctionne pas
Sub Macro1()
'
' Macro1 Macro
' Macro enregistrée le 08/07/2009 par ritchy
'
'
Rows("1:2").Select
Selection.Delete Shift:=xlUp
ActiveSheet.Shapes("Picture 1").Select
Selection.Delete
Range("A1:M1").Select
Selection.Interior.ColorIndex = 6
Selection.Font.Bold = True
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
Selection.Insert Shift:=xlToRight
Columns("E:E").Select
Selection.Cut
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
Range("A1
1").Select
Selection.Interior.ColorIndex = 6
Range("B1").Select
ActiveCell.FormulaR1C1 = "ORDER"
Range("C1").Select
ActiveCell.FormulaR1C1 = "GROUP"
Range("A1
1").Select
Selection.Font.Bold = False
Selection.Font.Bold = True
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("A1
1").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Columns("G:G").Select
Selection.Insert Shift:=xlToRight
Range("G1").Select
ActiveCell.FormulaR1C1 = "SIZE (TEU)"
With ActiveCell.Characters(Start:=1, Length:=10).Font
.Name = "Tahoma"
.FontStyle = "Gras"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
Range("G4").Select
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
Columns("K:K").Select
Selection.Insert Shift:=xlToRight
Columns("L:L").Select
Selection.Insert Shift:=xlToRight
Range("K1").Select
ActiveCell.FormulaR1C1 = "MOI1"
With ActiveCell.Characters(Start:=1, Length:=4).Font
.Name = "Tahoma"
.FontStyle = "Gras"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
Range("L1").Select
ActiveCell.FormulaR1C1 = "MOI2"
With ActiveCell.Characters(Start:=1, Length:=4).Font
.Name = "Tahoma"
.FontStyle = "Gras"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
Columns("O:O").Select
Selection.Insert Shift:=xlToRight
Range("O1").Select
ActiveCell.FormulaR1C1 = "MOI3"
With ActiveCell.Characters(Start:=1, Length:=4).Font
.Name = "Tahoma"
.FontStyle = "Gras"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
ActiveWorkbook.Save
End Sub
Sub Macro2()
'
' Macro2 Macro
' Macro enregistrée le 08/07/2009 par ritchy
'
'
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
Columns("K:K").Select
Selection.Insert Shift:=xlToRight
Range("K1").Select
ActiveCell.FormulaR1C1 = "MOI3"
With ActiveCell.Characters(Start:=1, Length:=4).Font
.Name = "Tahoma"
.FontStyle = "Gras"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
Columns("L:L").Select
Selection.Insert Shift:=xlToRight
Range("L1").Select
ActiveCell.FormulaR1C1 = "MOI4"
With ActiveCell.Characters(Start:=1, Length:=4).Font
.Name = "Tahoma"
.FontStyle = "Gras"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
Columns("M:M").Select
Selection.Insert Shift:=xlToRight
Range("M1").Select
ActiveCell.FormulaR1C1 = "MOI5"
With ActiveCell.Characters(Start:=1, Length:=4).Font
.Name = "Tahoma"
.FontStyle = "Gras"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
Range("M5").Select
End Sub
Private Sub CommandButton4_Click()
Macro1
Macro2
End Sub