GarysStudent
02-24-2014, 09:25 AM
If I want the minimum of the values from A1 thru A10, I can enter:
=Min(A1:A10) in a cell.
In VBA I can use:
Sub Sample()
Dim r As Range, v As Variant
Set r = Range("A1:A10")
v = Application.WorksheetFunction.Min(r)
End Sub
Now if I want the minimum value of A10 across sheets, I can enter:
=MIN(Sheet1:Sheet10!A10) in a worksheet cell.
I am trying to do the same thing in VBA using
Application.WorksheetFunction.Min
I can't find the correct syntax. The best I can find is:
v = Evaluate("Min(Sheet1:Sheet10!A10)")
Is this my only option??
=Min(A1:A10) in a cell.
In VBA I can use:
Sub Sample()
Dim r As Range, v As Variant
Set r = Range("A1:A10")
v = Application.WorksheetFunction.Min(r)
End Sub
Now if I want the minimum value of A10 across sheets, I can enter:
=MIN(Sheet1:Sheet10!A10) in a worksheet cell.
I am trying to do the same thing in VBA using
Application.WorksheetFunction.Min
I can't find the correct syntax. The best I can find is:
v = Evaluate("Min(Sheet1:Sheet10!A10)")
Is this my only option??