bobjazz
XLDnaute Impliqué
Bonjour le Forum
La macro fonctionne très bien sur excel 2013, sur excel 2010, la macro tourne en boucle, ne s’arrête pas.
Je ne vois pas pourquoi.
Sub Effligne()
Columns("T:T").Select
Selection.Delete Shift:=xlToLeft
Rows("1:1").Select
Range("B1").Activate
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveWindow.ScrollColumn = 1
Range("A1").Select
ActiveCell.FormulaR1C1 = "Numéro"
Range("B1").Select
ActiveCell.FormulaR1C1 = "Nom"
Range("C1").Select
ActiveCell.FormulaR1C1 = "Code"
Range("D1").Select
ActiveCell.FormulaR1C1 = "Type"
Range("E1").Select
ActiveCell.FormulaR1C1 = "Statue"
Range("F1").Select
ActiveCell.FormulaR1C1 = "Janv"
Selection.AutoFill Destination:=Range("F1:Q1"), Type:=xlFillDefault
Range("F1:Q1").Select
Range("R1").Select
ActiveCell.FormulaR1C1 = "Total"
Range("S1").Select
ActiveCell.FormulaR1C1 = "%"
Range("T1").Select
ActiveCell.FormulaR1C1 = "Taux"
Range("A1").Select
Dim z$, i&, k&
k = Cells(3000, 1).Row
For i = k To 2 Step -1
z = Cells(i, 1).Value
If Not (Cells(i, 1) Like ("6*") Or Cells(i, 1) Like ("7*") Or Cells(i, 1) Like ("E*")) Then Rows(i).Delete
Next
ActiveWorkbook.Save
Cells.Select
Cells.EntireColumn.AutoFit
End Sub
Merci d'avance
Bobjazz
La macro fonctionne très bien sur excel 2013, sur excel 2010, la macro tourne en boucle, ne s’arrête pas.
Je ne vois pas pourquoi.
Sub Effligne()
Columns("T:T").Select
Selection.Delete Shift:=xlToLeft
Rows("1:1").Select
Range("B1").Activate
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveWindow.ScrollColumn = 1
Range("A1").Select
ActiveCell.FormulaR1C1 = "Numéro"
Range("B1").Select
ActiveCell.FormulaR1C1 = "Nom"
Range("C1").Select
ActiveCell.FormulaR1C1 = "Code"
Range("D1").Select
ActiveCell.FormulaR1C1 = "Type"
Range("E1").Select
ActiveCell.FormulaR1C1 = "Statue"
Range("F1").Select
ActiveCell.FormulaR1C1 = "Janv"
Selection.AutoFill Destination:=Range("F1:Q1"), Type:=xlFillDefault
Range("F1:Q1").Select
Range("R1").Select
ActiveCell.FormulaR1C1 = "Total"
Range("S1").Select
ActiveCell.FormulaR1C1 = "%"
Range("T1").Select
ActiveCell.FormulaR1C1 = "Taux"
Range("A1").Select
Dim z$, i&, k&
k = Cells(3000, 1).Row
For i = k To 2 Step -1
z = Cells(i, 1).Value
If Not (Cells(i, 1) Like ("6*") Or Cells(i, 1) Like ("7*") Or Cells(i, 1) Like ("E*")) Then Rows(i).Delete
Next
ActiveWorkbook.Save
Cells.Select
Cells.EntireColumn.AutoFit
End Sub
Merci d'avance
Bobjazz