Réaction n°4 |
par flyonets le 13/10/2007 - 18:28
Bonjour une variante un peu plus rapide qui supprime tout en une seule fois ici le code s'applique aux lignes masquées, il suffira d'adapter Sub Delhiddenrows() 'objectIF IDENTIFIER DES LIGNES MASQUÉES POUR LES VIDER Dim K&, Y&, Tmp, Ctd As New Collection, Plage As Range Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Set Plage = Range("A1").CurrentRegion 'à adapter Set Plage = Plage.Resize(Plage.Rows.Count, 1).Offset(1, 0) Y = Cells(65536, 1).End(xlUp).Row + 1 With Plage For Each Tmp In Plage If Tmp.EntireRow.Hidden = True Then 'stockage des numeros de lignes masquées Ctd.Add Tmp.Row, CStr(Tmp.Row) End If Next End With If Ctd.Count = 0 Then Exit Sub 'definition de la plage des lignes masquées For K = 1 To Ctd.Count 'Range("E" & Ctd(K)).Value = Ctd(K) If K = 1 Then Set Plage = Rows(Ctd(K)) Set Plage = Union(Plage, Rows(Ctd(K))) Next 'Marquage ou Raz des lignes masquées With Plage '.RowHeight = 12 'affichage des lignes masquées .Interior.ColorIndex = 33 'AU CHOIX .ClearContents 'AU CHOIX .Delete 'AU CHOIX End With Application.Calculation = xlCalculationAutomatic Set Plage = Nothing End Sub Bonne soirée |