[COLOR=GRAY][B][I]DANS UN MODULE DE CODE STANDARD[/I][/B][/COLOR]
[COLOR=NAVY]Option Explicit[/COLOR]
[COLOR=NAVY]Sub[/COLOR] LignFiltrees()
[COLOR=GREEN]'myDearFriend! - www.mdf-xlpages.com[/COLOR]
[COLOR=NAVY]Dim[/COLOR] Plage [COLOR=NAVY]As[/COLOR] Range
[COLOR=NAVY]With[/COLOR] ActiveSheet
[COLOR=NAVY]Set[/COLOR] Plage = Intersect(.UsedRange, .Cells.SpecialCells(xlCellTypeVisible), _
.Range(.Cells(2, 1), .Cells(Application.Rows.Count, 256)))
[COLOR=NAVY]End With[/COLOR]
MsgBox "1ere ligne visible = " & Plage(1).Row
MsgBox "Dernière ligne visible = " & Plage(Plage.Count).Row
[COLOR=NAVY]End Sub[/COLOR]
Sub Macro1()
Dim pl As Integer 'déclare la variable pl
Dim dl As Integer 'déclare la variable dl
Dim x As Integer 'déclare la variable x
Dim y As Integer 'déclare la variable y
For x = 2 To Range("A65536").End(xlUp).Row 'boucle sur les cellules éditée de la colonne A
If Cells(x, 1).EntireRow.Hidden = False Then 'condition : si la ligne de la cellule st visible
pl = x 'définit la variable pl
Exit For 'sort de la boucle
End If 'fin de la condition
Next x 'nouvelle cellule de la boucle
'idem mais inversé (de la dernière en remontant)
For y = Range("A65536").End(xlUp).Row To 2 Step -1
If Cells(y, 1).EntireRow.Hidden = False Then
dl = y
Exit For
End If
Next y
MsgBox "la première ligne est " & pl & ", la dernière ligne est " & dl & "." 'message
End Sub