1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Dim cellvide As Long
Dim celldepart As Range
Worksheets("Buffer").Activate
Set celldepart = [A1]
cellvide = PremiereLigneVide(celldepart, xlByRows, xlNext)
Function PremiereLigneVide(CelluleDepart As Range, MonOrdre As XlSearchOrder, MaDirection As XlSearchDirection) As Long
Dim tmpPremLigne As Long
If MonOrdre = xlByRows Then
tmpPremLigne = Columns(CelluleDepart.Column).Find("", CelluleDepart, , , MonOrdre, MaDirection).Row
If (tmpPremLigne = 2) And IsEmpty(CelluleDepart(1, 1)) _
Then
PremiereLigneVide = 1
Else
PremiereLigneVide = tmpPremLigne
End If
Else
tmpPremLigne = Columns(CelluleDepart.Column).Find("", After:=CelluleDepart, SearchOrder:=MonOrdre, SearchDirection:=MaDirection).Column
End If
End Function |
Partager