N
Normek
Hi Fellow Excel users,
Has anyone come across the following problem before and do they have an
answer?
End(xlDown) is a useful shortcut method, however in a macro similar to this
below, if the cells below contains only one record or no records, then the
count is 1048575 in Excel 2007 or >50000 in excel 2003.
Sub CntCells()
ans = Range(Range("A1"), Range("A1").End(xlDown)).Count
MsgBox ans
End Sub
Similarly
Range("A1").End(xlDown).Offset(1, 0).Select
fails because Range("A1").End(xlDown).Select will select the last row
Has anyone any thoughts or alternatives?
Thanks in advance
Has anyone come across the following problem before and do they have an
answer?
End(xlDown) is a useful shortcut method, however in a macro similar to this
below, if the cells below contains only one record or no records, then the
count is 1048575 in Excel 2007 or >50000 in excel 2003.
Sub CntCells()
ans = Range(Range("A1"), Range("A1").End(xlDown)).Count
MsgBox ans
End Sub
Similarly
Range("A1").End(xlDown).Offset(1, 0).Select
fails because Range("A1").End(xlDown).Select will select the last row
Has anyone any thoughts or alternatives?
Thanks in advance