Solved

Max Value

Posted on 2004-09-27
1
167 Views
Last Modified: 2010-05-02
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
Comment
Question by:skpd1978
1 Comment
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 250 total points
ID: 12164734
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now