[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

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...
0
skpd1978
Asked:
skpd1978
1 Solution
 
Mike TomlinsonMiddle 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

~IM
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now