0

Type some value in column H rows 1 and 2 (can be any column, using H for the purpose of the example). Leave the rest of the column blank.

MsgBox (Range("H:H").End(xlDown).Row)

produces "2" as expected

Clear the cell in row 2, keeping only a value in row 1.

Now,

MsgBox (Range("H:H").End(xlDown).Row)

produces "1048576" !!!!!!!!!!! Shouldn't it produce "1" ?

Thanks.

BigBen
  • 46,229
  • 7
  • 24
  • 40
  • start at the bottom and go up: `MsgBox Range("H"& Rows.Count).End(xlUp).Row` – Scott Craner Mar 18 '20 at 15:28
  • As to why the big number. do it manually. Put a value only in H1. Click on that cell. Then hit Ctrl-DownArrow. You will see it goes to the bottom of the sheet. – Scott Craner Mar 18 '20 at 15:29
  • Thanks for all the help I received, my problem is solved.(Is this the way to thank someone who has helped you on Stack Overflow?) – Nuno Ferreira Mar 19 '20 at 16:15

0 Answers0