need max of 6 values function

Posted on 2006-04-13
Medium Priority
Last Modified: 2010-05-01
I need a function that accepts six integer parameter and returns maximum value of the six parameters.
Question by:campbe07
1 Comment
LVL 13

Accepted Solution

rettiseert earned 2000 total points
ID: 16450213
is this homework?

Function Max(Val1, Val2, Val3, Val4, Val5, Val6)

    Dim V(1 To 6)
    Dim i As Long
    V(1) = Val1
    V(2) = Val2
    V(3) = Val3
    V(4) = Val4
    V(5) = Val5
    V(6) = Val6
    For i = 1 To 6
        If V(i) > Max Then Max = V(i)

End Function

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

755 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