Hi guys,
I'm new at writing vba and am trying to get this user form working but keep getting the compile error: Else without if.
The bolded text is what the editor highlights. What am I going wrong?
I'm new at writing vba and am trying to get this user form working but keep getting the compile error: Else without if.
Code:
Private Sub cmdOK_Click()
ActiveWorkbook.Sheets("Course Bookings").ActivateRange("A1").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = txtName.Value
ActiveCell.Offset(0, 1) = txtPhone.Value
ActiveCell.Offset(0, 2) = cboDepartment.Value
ActiveCell.Offset(0, 3) = cboCourse.Value
If optIntroduction = True Then ActiveCell.Offset(0, 4).Value = "Intro"
[B]ElseIf optIntermediate = True Then[/B]
ActiveCell.Offset(0, 4).Value = "Intermd"
Else
ActiveCell.Offset(0, 4).Value = "Adv"
End If
If chkLunch = True Then
ActiveCell.Offset(0, 5).Value = "Yes"
Else
ActiveCell.Offset(0, 5).Value = "No"
End If
If chkVegetarian = True Then
ActiveCell.Offset(0, 6).Value = "Yes"
Else
If chkLunch = False Then
ActiveCell.Offset(0, 6).Value = ""
Else
ActiveCell.Offset(0, 6).Value = "No"
End If
Range("A1").Select
The bolded text is what the editor highlights. What am I going wrong?