MAX Function in a Macro

lgarcia3
03-09-2001, 11:38 AM
I want to use the Max Function in a Macro to determine the maximun value in a set. How can I do that if I can at all. Any code I can see.
Thanks

RDH
03-10-2001, 08:57 AM
You can use any worksheet function, including MAX, in VBA by preceeding the function name with "Application.Worksheetfunction." For example,

Maximum = Application.Worksheetfunction.Max(Worksheets("Sheet1").Range("F23:O25"))

This would set the variable "Maximum" to the max value of the specified cell range on Sheet1.

RDH

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum