Max Value

How to find max value in selected range in VB code, also give some other ifo about statistical functions or statements or proerties I can use in Vb programming. like, average, standered deviation etc...
Who is Participating?
Mike TomlinsonConnect With a Mentor Middle School Assistant TeacherCommented:
Using Application.WorksheetFunction you can use almost any function you could on a worksheet from within VB code:

    Public Sub foo()
        maxValue = Application.WorksheetFunction.Max(Worksheets("Sheet1").Range(Cells(1, 1), Cells(5, 3)))
        MsgBox maxValue
    End Sub

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.