View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Determining the row limit in a macro

Jeff,

I printed out the results for versions 1 to 12.

1 1048576
2 1048576
3 1048576
4 1048576
5 1048576
6 1048576
7 1048576
8 1048576
9 1048576
10 65536
11 65536
12 65536

that doesn't seem correct to me. You must have something mixed up in your
UDF.

Just a heads up.

--
Regards,
Tom Ogilvy


"Jeff" wrote:

reurn max number of rows by version

Function MaxRow(ByVal Version As Double) As Long
Select Case Version
Case Is 9
MaxRow = 65536
Case 10#
MaxRow = 65536
Case Is < 10
MaxRow = 1048576
End Select
End Function

"Ryan H" wrote:

This will count the number of rows available in whichever Excel version you
use. Hope this helps! If so, let me know, click "YES" below.

Sub CountRows()

Dim NumberOfRows As Long

NumberOfRows = Rows.Count
MsgBox NumberOfRows

End Sub
--
Cheers,
Ryan


"Phil Hibbs" wrote:

How can a macro determine what the maximum number of rows is in the
version of Excel that is running? I don't want to just hard-code
version numbers, and I don't want to use .end(xldown) either.

Phil Hibbs.
.