+ Reply to Thread
Results 1 to 5 of 5

VBA Functions Excel 2002

  1. #1
    Sherry
    Guest

    VBA Functions Excel 2002

    Please help.
    I have created a Function (see below) but regardles of the numbers I enter,
    I can only get one result to display. That result is Poor-Improving
    Grrrr! What am I missing here? can anyone help-Please!!!

    Function EvalAll(OverallEval As Double)

    If RecentEvaluation >= OverallEvaluation And OverallEvaluation > 4 Then
    EvalAll = "Good-Improving"
    ElseIf RecentEvaluation >= OverallEvaluation And OverallEvaluation < 4 Then
    EvalAll = "Poor-Improving"
    ElseIf RecentEvaluation >= OverallEvaluation And OverallEvaluation > 4 Then
    EvalAll = "Good-Improving"
    ElseIf RecentEvaluation >= OverallEvaluation And OverallEvaluation > 4 Then
    EvalAll = "Poor-Interview"

    End If
    End Function

    I have looked at this for so long without success and now I am not sure what
    I am doing anymore!!!

    Cheers Sherry

  2. #2
    JulieD
    Guest

    Re: VBA Functions Excel 2002

    Hi Sherry

    two problems as i see it
    one - you're only passing in the OverallEval parameter not the
    RecentEvaluation parameter
    two - you're passing in a parameter called "OverallEval" but calling it
    "OveralLEvaluation" in the function itself


    --
    Cheers
    JulieD
    check out www.hcts.net.au/tipsandtricks.htm
    ....well i'm working on it anyway
    "Sherry" <[email protected]> wrote in message
    news:[email protected]...
    > Please help.
    > I have created a Function (see below) but regardles of the numbers I
    > enter,
    > I can only get one result to display. That result is Poor-Improving
    > Grrrr! What am I missing here? can anyone help-Please!!!
    >
    > Function EvalAll(OverallEval As Double)
    >
    > If RecentEvaluation >= OverallEvaluation And OverallEvaluation > 4 Then
    > EvalAll = "Good-Improving"
    > ElseIf RecentEvaluation >= OverallEvaluation And OverallEvaluation < 4
    > Then
    > EvalAll = "Poor-Improving"
    > ElseIf RecentEvaluation >= OverallEvaluation And OverallEvaluation > 4
    > Then
    > EvalAll = "Good-Improving"
    > ElseIf RecentEvaluation >= OverallEvaluation And OverallEvaluation > 4
    > Then
    > EvalAll = "Poor-Interview"
    >
    > End If
    > End Function
    >
    > I have looked at this for so long without success and now I am not sure
    > what
    > I am doing anymore!!!
    >
    > Cheers Sherry




  3. #3
    Sherry
    Guest

    Re: VBA Functions Excel 2002

    Hello JulieD

    I am sorry but I do not understand what you mean by passing in the parameter!!

    I did however pick up on typo of OverallEval that should have been
    OverallEvaluation

    Any further elaboration would be helpful

    Thank You Cheers Sherry

    "JulieD" wrote:

    > Hi Sherry
    >
    > two problems as i see it
    > one - you're only passing in the OverallEval parameter not the
    > RecentEvaluation parameter
    > two - you're passing in a parameter called "OverallEval" but calling it
    > "OveralLEvaluation" in the function itself
    >
    >
    > --
    > Cheers
    > JulieD
    > check out www.hcts.net.au/tipsandtricks.htm
    > ....well i'm working on it anyway
    > "Sherry" <[email protected]> wrote in message
    > news:[email protected]...
    > > Please help.
    > > I have created a Function (see below) but regardles of the numbers I
    > > enter,
    > > I can only get one result to display. That result is Poor-Improving
    > > Grrrr! What am I missing here? can anyone help-Please!!!
    > >
    > > Function EvalAll(OverallEval As Double)
    > >
    > > If RecentEvaluation >= OverallEvaluation And OverallEvaluation > 4 Then
    > > EvalAll = "Good-Improving"
    > > ElseIf RecentEvaluation >= OverallEvaluation And OverallEvaluation < 4
    > > Then
    > > EvalAll = "Poor-Improving"
    > > ElseIf RecentEvaluation >= OverallEvaluation And OverallEvaluation > 4
    > > Then
    > > EvalAll = "Good-Improving"
    > > ElseIf RecentEvaluation >= OverallEvaluation And OverallEvaluation > 4
    > > Then
    > > EvalAll = "Poor-Interview"
    > >
    > > End If
    > > End Function
    > >
    > > I have looked at this for so long without success and now I am not sure
    > > what
    > > I am doing anymore!!!
    > >
    > > Cheers Sherry

    >
    >
    >


  4. #4
    Gary's Student
    Guest

    Re: VBA Functions Excel 2002

    How does your macro know the value of RecentEvaluation?
    --
    Gary's Student


    "Sherry" wrote:

    > Hello JulieD
    >
    > I am sorry but I do not understand what you mean by passing in the parameter!!
    >
    > I did however pick up on typo of OverallEval that should have been
    > OverallEvaluation
    >
    > Any further elaboration would be helpful
    >
    > Thank You Cheers Sherry
    >
    > "JulieD" wrote:
    >
    > > Hi Sherry
    > >
    > > two problems as i see it
    > > one - you're only passing in the OverallEval parameter not the
    > > RecentEvaluation parameter
    > > two - you're passing in a parameter called "OverallEval" but calling it
    > > "OveralLEvaluation" in the function itself
    > >
    > >
    > > --
    > > Cheers
    > > JulieD
    > > check out www.hcts.net.au/tipsandtricks.htm
    > > ....well i'm working on it anyway
    > > "Sherry" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Please help.
    > > > I have created a Function (see below) but regardles of the numbers I
    > > > enter,
    > > > I can only get one result to display. That result is Poor-Improving
    > > > Grrrr! What am I missing here? can anyone help-Please!!!
    > > >
    > > > Function EvalAll(OverallEval As Double)
    > > >
    > > > If RecentEvaluation >= OverallEvaluation And OverallEvaluation > 4 Then
    > > > EvalAll = "Good-Improving"
    > > > ElseIf RecentEvaluation >= OverallEvaluation And OverallEvaluation < 4
    > > > Then
    > > > EvalAll = "Poor-Improving"
    > > > ElseIf RecentEvaluation >= OverallEvaluation And OverallEvaluation > 4
    > > > Then
    > > > EvalAll = "Good-Improving"
    > > > ElseIf RecentEvaluation >= OverallEvaluation And OverallEvaluation > 4
    > > > Then
    > > > EvalAll = "Poor-Interview"
    > > >
    > > > End If
    > > > End Function
    > > >
    > > > I have looked at this for so long without success and now I am not sure
    > > > what
    > > > I am doing anymore!!!
    > > >
    > > > Cheers Sherry

    > >
    > >
    > >


  5. #5
    Duke Carey
    Guest

    RE: VBA Functions Excel 2002

    The first, third, and fourth of your conditions are the same:

    RecentEvaluation >= OverallEvaluation And OverallEvaluation > 4

    and in ALL 4 cases you are testing for RecentEvaluation >= OverallEvaluation

    How about
    ====================================
    If RecentEvaluation >= OverallEvaluation Then
    If OverallEvaluation > 4 Then
    EvalAll = "Good-Improving"
    Else
    EvalAll = "Poor-Improving"
    End If
    Else
    ' this portion is in case RecentEvaluation < OverallEvaluation
    If OverallEvaluation > 4 Then
    EvalAll = "??"
    Else
    EvalAll = "Poor-Interview??"
    End If
    End If
    ===================================

    If RecentEvaluation >= OverallEvaluation then


    "Sherry" wrote:

    > Please help.
    > I have created a Function (see below) but regardles of the numbers I enter,
    > I can only get one result to display. That result is Poor-Improving
    > Grrrr! What am I missing here? can anyone help-Please!!!
    >
    > Function EvalAll(OverallEval As Double)
    >
    > If RecentEvaluation >= OverallEvaluation And OverallEvaluation > 4 Then
    > EvalAll = "Good-Improving"
    > ElseIf RecentEvaluation >= OverallEvaluation And OverallEvaluation < 4 Then
    > EvalAll = "Poor-Improving"
    > ElseIf RecentEvaluation >= OverallEvaluation And OverallEvaluation > 4 Then
    > EvalAll = "Good-Improving"
    > ElseIf RecentEvaluation >= OverallEvaluation And OverallEvaluation > 4 Then
    > EvalAll = "Poor-Interview"
    >
    > End If
    > End Function
    >
    > I have looked at this for so long without success and now I am not sure what
    > I am doing anymore!!!
    >
    > Cheers Sherry


+ 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