Dim total_visible As Long, a As Range, jusquou As Long For Each a In Range("A2:A50").SpecialCells(xlCellTypeVisible).Areas total_visible = total_visible + a.Rows.Count Next jusquou = Range("A2:A50").Row + 20 + Range("A2:A50").Rows.Count - total_visible MsgBox jusquou
Dim total_visible As Long, i As Long, toto As Long For i = Range("A" & Rows.Count).End(xlUp).Row To 1 Step -1 If Rows(i).Hidden False Then toto toto + 1 If toto >= 20 Then Exit For Next MsgBox "tu dois donc ne garder qu'à partir de la ligne " & i
Dim i As Long, toto As Long For i = Range("A" & Rows.Count).End(xlUp).Row To 1 Step -1 If Rows(i).Hidden False Then toto toto + 1 If toto >20 Then i i - 1: Exit For Next MsgBox "tu dois donc ne garder qu'à partir de la ligne " & i + 1
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionavec un offset(-jusquou;0)
ça fonctionne parfaitement quelque soit le nombre de lignes de départ.
Attention, toutefois ... il te faut y ajouter une condition, hein ... Allez : devine laquelle (fastoche).