Compile Error ElseIf Without If.........But there is an If ! ???
When you have the action on the same line as the If , there is no closing
End If required. As you have Else clauses, you need to structre it like so
If (Range("D9").Value) < 0 Then
Range("D9").ClearContents:
UserForm6.Show
ElseIf (Range("D9").Value) 125 Then
Range("D9").ClearContents
UserForm6.Show
End If
--
---
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
"dim" wrote in message
...
Hi folks,
Can someone please try and debug this code for me? ARGHHHH!! I just don't
get it, why am I getting the compile error, there is obviously an 'If' so
why
is it saying there's not?
If (Range("D9").Value) < 0 Then Range("D9").Select:
Selection.ClearContents:
UserForm6.Show
ElseIf (Range("D9").Value) 125 Then Range("D9").Select:
Selection.ClearContents: UserForm6.Show
End If
Thankyou for any advice.
|