castor30
XLDnaute Occasionnel
Bonjour
Je rencontre un problème avec ce code
Sub Filtrage()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.DisplayAlerts = False
DerLig = [A10000].End(xlUp).Row
If ActiveSheet.AutoFilterMode Then
isOn = "On"
Range("E1:E" & DerLig).AutoFilter Field:=1
For i = 2 To DerLig Step 2
Range(Cells(i, "E"), Cells(i + 1, "E")).MergeCells = True
Next i
ActiveSheet.AutoFilterMode = False
Exit Sub
Else
isOn = "Off"
Range("E:E").Select
Selection.AutoFilter
End If
For i = 2 To DerLig Step 2
If Cells(i, "E") = "x" Then
Range(Cells(i, "E"), Cells(i + 1, "E")).MergeCells = False
Cells(i + 1, "E") = "x"
End If
Next i
Range("E:E" & DerLig).AutoFilter Field:=5, Criteria1:="x" 'cette ligne est surlignée en jaune
Application.Calculation = xlCalculationAutomatic
End Sub
Peut être est-ce parce que je suis sous xl2003
Je vous remercie
Je rencontre un problème avec ce code
Sub Filtrage()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.DisplayAlerts = False
DerLig = [A10000].End(xlUp).Row
If ActiveSheet.AutoFilterMode Then
isOn = "On"
Range("E1:E" & DerLig).AutoFilter Field:=1
For i = 2 To DerLig Step 2
Range(Cells(i, "E"), Cells(i + 1, "E")).MergeCells = True
Next i
ActiveSheet.AutoFilterMode = False
Exit Sub
Else
isOn = "Off"
Range("E:E").Select
Selection.AutoFilter
End If
For i = 2 To DerLig Step 2
If Cells(i, "E") = "x" Then
Range(Cells(i, "E"), Cells(i + 1, "E")).MergeCells = False
Cells(i + 1, "E") = "x"
End If
Next i
Range("E:E" & DerLig).AutoFilter Field:=5, Criteria1:="x" 'cette ligne est surlignée en jaune
Application.Calculation = xlCalculationAutomatic
End Sub
Peut être est-ce parce que je suis sous xl2003
Je vous remercie