+ Reply to Thread
Results 1 to 3 of 3

Vba Help With A Solution

  1. #1
    Registered User
    Join Date
    07-31-2005
    Posts
    7

    Question Vba Help With A Solution

    HI THERE IM HAVING TROUBLE PRODUCING SOME VBA CODING IN MICROSOFT EXCEL THAT WILL IMPLIMENT THE FOLLOWING CODE, I WOULD BE GREATFULL IF ANYONE COULD HELP ME ON THIS A.S.A.P BECAUSE I AM NEW TO USING VBA AND FINDING IT ALL VERY CONFUSING undefined

    SET maximum value=0
    LOOP
    INPUT a score between 1-10
    IF the maximum value is smaller than the input score
    SET maximum value=input score
    END IF
    END LOOP(repeat 4 times)
    DISPLAY the maximum value with a suitable message

  2. #2
    Norman Jones
    Guest

    Re: Vba Help With A Solution

    Hi Relwod85.

    Try something like:

    Public Sub Tester()
    Dim i As Long
    Dim arr As Variant
    Dim myVal As Double
    Static MyMax As Variant

    MyMax = 0

    arr = Array("FIRST", "SECOND", "THIRD", "LAST")

    For i = 1 To 4

    myVal = Application.InputBox( _
    prompt:="Please enter a " & _
    arr(i - 1) & " number", _
    Type:=2, _
    Title:="Find Maximum", _
    Default:=0)

    MyMax = Application.Max(myVal, MyMax)

    Next i

    MsgBox "Your highest entry was: " & MyMax

    End Sub

    BTW, Please try to avoid upper case communication: in NG parlance this
    equates to shouting and, in any event, is uncommonly difficult to read!

    ---
    Regards,
    Norman



    "RELWOD85" <[email protected]> wrote in
    message news:[email protected]...
    >
    > HI THERE IM HAVING TROUBLE PRODUCING SOME VBA CODING IN MICROSOFT EXCEL
    > THAT WILL IMPLIMENT THE FOLLOWING CODE, I WOULD BE GREATFULL IF ANYONE
    > COULD HELP ME ON THIS A.S.A.P BECAUSE I AM NEW TO USING VBA AND FINDING
    > IT ALL VERY CONFUSING undefined
    >
    > SET maximum value=0
    > LOOP
    > INPUT a score between 1-10
    > IF the maximum value is smaller than the input score
    > SET maximum value=input score
    > END IF
    > END LOOP(repeat 4 times)
    > DISPLAY the maximum value with a suitable message
    >
    >
    > --
    > RELWOD85
    > ------------------------------------------------------------------------
    > RELWOD85's Profile:
    > http://www.excelforum.com/member.php...o&userid=25753
    > View this thread: http://www.excelforum.com/showthread...hreadid=391632
    >




  3. #3
    Norman Jones
    Guest

    Re: Vba Help With A Solution

    Hi Relwod,

    Change:

    > Type:=2, _


    to

    Type:=1, _
    ---
    Regards,
    Norman



    "Norman Jones" <[email protected]> wrote in message
    news:%23RTg%[email protected]...
    > Hi Relwod85.
    >
    > Try something like:
    >
    > Public Sub Tester()
    > Dim i As Long
    > Dim arr As Variant
    > Dim myVal As Double
    > Static MyMax As Variant
    >
    > MyMax = 0
    >
    > arr = Array("FIRST", "SECOND", "THIRD", "LAST")
    >
    > For i = 1 To 4
    >
    > myVal = Application.InputBox( _
    > prompt:="Please enter a " & _
    > arr(i - 1) & " number", _
    > Type:=2, _
    > Title:="Find Maximum", _
    > Default:=0)
    >
    > MyMax = Application.Max(myVal, MyMax)
    >
    > Next i
    >
    > MsgBox "Your highest entry was: " & MyMax
    >
    > End Sub
    >
    > BTW, Please try to avoid upper case communication: in NG parlance this
    > equates to shouting and, in any event, is uncommonly difficult to read!
    >
    > ---
    > Regards,
    > Norman




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1