Yeah, as Alex suggests, that should not be possible, as there is no row 0 on any Excel sheet!
Are you sure that you are not subtracting one from it or something? That could lead you to zero if if goes up to row one.
If that really is your result, then you most likely have some sort of logic or coding error. If you post your code, as Alex asked, we may be able to spot where the issue is.
BTW, instead of using:
VBA Code:
r = Range("A1048576").End(xlUp).Row
I usually like to use this instead, which will also work on older versions of Excel that do not have that many rows (a more universal solution):
VBA Code:
r = Cells(Rows.Count, "A").End(xlUp).Row
BTW, you do not have to preface your range with "ActiveSheet". If you leave the sheet reference off, it assumes and runs against the ActiveSheet.
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.