[VBA] Detecting Empty Cell

Solved
Doudou95 Posted messages 1897 Registration date   Status Member Last intervention   -  
 narval -
Hello,

I'm sure it's something really simple but I'm stuck...

I would like to create a loop that counts the number of rows (Excel table) and, when it reaches an empty cell, which indicates the last row, saves the number of rows in a variable.
Thanks for this little help in advance.
Configuration: Windows XP Internet Explorer 8.0

5 answers

  1. onesdf Posted messages 375 Registration date   Status Member Last intervention   120
     
     ' Select the first cell of the table Range("A1").Select ' Loop while not empty Do While Not (IsEmpty(ActiveCell)) NbLigne = NbLigne + 1 Selection.Offset(1, 0).Select Loop 
    67