One way:
Sub test()
' put a value in cell B3, say 10
Dim i As Long
i = 3
i = WorksheetFunction.Max(i, Range("B3"))
MsgBox i
End Sub
Regards
Trevor
"jbl25" wrote in message
...
Hello,
How do I take the max of 2 integer values in VBA? (I'd like to set a
variable = to the max of itself and a cell reference which contains an
int) Thank you!
--
jbl25
------------------------------------------------------------------------
jbl25's Profile:
http://www.excelforum.com/member.php...fo&userid=7225
View this thread: http://www.excelforum.com/showthread...hreadid=264883