Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • 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
Joined
Nov 23, 2001
Messages
67
Location
US
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
 
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

Back
Top