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
Thanks,
Dave
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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