• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 109
  • Last Modified:

Syntax error for ElseIf

I am having a problem with the syntax in line 8 and need help here please
Sub UserInput()
   Dim Results As Variant
    Results = Range("L9").Value
    If Not (IsNumeric(Results)) Then 'not a number
        MsgBox "Invalid value for Significance – must be numeric!", vbCritical
    ElseIf Results = "<=0" or Results "=>1" Then 'The value must be great than 0 and less than 1
        MsgBox "Invalid value for Significance - must not be greater than zero but less than 1!", vbCritical
    End If

End Sub

Open in new window

Frank Freese
Frank Freese
  • 2
1 Solution
Shaun KlineLead Software EngineerCommented:
Did you mean this?

   ElseIf Results <= 0 or Results => 1 Then 'The value must be great than 0 and less than 1

The error you are probably having is that after "or Results" you do not have an equivalency operator.
Frank FreeseAuthor Commented:
Yes it is but I've got myself into an end less loop?
Frank FreeseAuthor Commented:
Thank you
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now