Bonjour, dans le code ci-dessous je voudrais qu'il fasse un choix aléatoire mais seulement des lignes non vides.
Donc ne pas tenir compte par exemple des lignes " 25, 66,356, 5900, et de plein d'autres qui ne contiennent rien ."
Merci tout plein..
Option Explicit
Option Private Module
Public Sub LigneHasard()
Dim objList As ListObject
Dim lrow As Long
Dim lRnd As Double
Set objList = Feuil1.ListObjects(1)
With Feuil2
lrow = .Cells(Rows.Count, 1).End(xlUp).Row + 1
Randomize
lRnd = Application.RandBetween(1, 25000)
objList.ListRows(lRnd).Range.Copy .Cells(lrow, 1)
End With
Set objList = Nothing
End Sub