Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Min(), Max() in Excel VBA?

Status
Not open for further replies.

davidd31415

Electrical
Nov 23, 2001
67
Is there a way to make use of Excel's built in Min and Max functions within a VBA program? I would like the returned value to be stored in an integer, not in a cell.

Thanks,

Dave
 
Replies continue below

Recommended for you

Excel VBA Help said:
WorksheetFunction Property

Returns the WorksheetFunction object. Read-only.

Example
This example displays the result of applying the Min worksheet function to the range A1:A10.

Code:
Set myRange = Worksheets("Sheet1").Range("A1:C10")
answer = Application.WorksheetFunction.Min(myRange)
MsgBox answer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor