Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88054

Issue with VBA ElseIf Statement [duplicate]

$
0
0

This is my code. I can't seem to find what's wrong with it. Whenever I run the code manually or through a button, it doesn't work nor give me an error

'Determine whether levels is applicable
Sub CheckLevel()

'Check for single entity first

If Range("B4").Value = 1120 Or 1120 - PC Or 1120 - L Then
    Range("B7").Value = "It's a Single Entity Level"'Check for Legal Entity

ElseIf Range("B4").Value = 11202 Or 1120 - L4 Or 1120 - PC6 Then
    Range("B7").Value = "It's a Legal Entity Level"'Check for Entity Group

ElseIf Range("B4").Value = 11203 Or 1120 - L5 Or 1120 - PC7 Then
     Range("B7").Value = "It's a Entity Group Level"'Check for values that do not have a level

Else
    Range("B7").Value = "It's Not a Level"


End If

End Sub

Viewing all articles
Browse latest Browse all 88054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>