Greetings fellow VBA'ers. I am relatively new to VBA programming but am working on some VBA code for work. I am using Excel 2003, and have really been struggling with structuring nested if/then/else logic properly. I often get "End If without Block If" errors such as in the case below. Can somebody help me with the proper structure? Thanks in advance.
----------------------------------------
Yes, I know that the code is probably very inefficient. Right now, I'm just trying to get something that works.
Sub Adjust()
Dim Pattern As Integer
Pattern = Sheets("Info").Range("R7").Value
If Pattern = 1 Then Call OneCrew Else End If
If Pattern = 2 Then Call TwoCrew Else End If
If Pattern = 3 Then Call ThreeCrew Else End If
If Pattern = 4 Then Call OneCrew Else End If
If Pattern = 5 Then Call TwoCrew Else End If
If Pattern = 6 Then Call ThreeCrew Else End If
End Sub
Bookmarks