Still some problems with your code. First off, you need to specify
Application.Version and not just Version by itself for the object of the
Select Case statement. Second, any version greater than 9 (that is, 10, 11,
12, etc.) will be trapped by your first Case statement... you have to test
the higher numbered versions first. Also, did you separate Versions 9 and 10
instead of combining them a single Case statement (which, by the way, won't
be necessary once you reverse the order of the tests)? Also, so you don't
have to remember those large numbers, you can use powers of 2 instead...
Function MaxRow(ByVal Version As Double) As Long
Select Case Application.Version
Case Is > 10
MaxRow = 2 ^ 16 ' This equals 65536
Case Else
MaxRow = 2 ^ 20 ' This equals 1048576
End Select
End Function