need max of 6 values function

Posted on 2006-04-13
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

    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Suggested Solutions

    The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    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…
    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…

    737 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

    21 Experts available now in Live!

    Get 1:1 Help Now