Application.Max wierdness
Tushar Mehta wrote
You are probably better off leaving the column formatted for General,
but you can have your cake and eat it to. To force XL to do a type
conversion and then get the largest value in the column, use
evaluate("Max(0+" & range(range("a1"),cells(rows.Count,1).end
(xlup)).Address & ")")
Hmm... Elegant. However, after subbing "j1" for "a1" to match my check#
column, substituted your Evaluate formula for existing offset reference,
reformatted the column as Text, manually typed in a check # then ran the
macro for next check and no increment :(
Your offering does work if I don't manually enter a check# before running
the macro.
Further observation: If I highlight two check#'s above my target and
autofill down one instead of manually typing the check#, then run the
macro, things work no matter what the format.
I'm obviously missing something. Lacking further clarification, I think
I'll leave as General and go with Peter's Custom format and enjoy my cake.
--
David
|