Hi! I am Xavier and I'm rather new to excel. Recently at my internship, I am tasked to do up a user form without having help from my superiors. I went online to get a Template and started working on it. However, I am stuck at debuging a certain portion of the codes and keep getting compile error: Block if without end.
' Check all the data(except remarks field) has entered are not on the userform
Sub Data_Validation()
If txtAgn = "" Then
MsgBox "Enter Name!", vbInformation, "Agency Name"
Exit Sub
If txtIATA = "" Then
MsgBox "Enter Code!", vbInformation, "Agency IATA Code"
Exit Sub
If txtNOS = "" Then
MsgBox "Enter Name!", vbInformation, "Staff Name"
Exit Sub
If txtStaffd = "" Then
MsgBox "Enter designation", vbInformation, "Staff Designation"
Exit Sub
If txtEAddr = "" Then
MsgBox "Enter Address", vbInformation, "Email Address"
Exit Sub
If txtCNum = "" Then
MsgBox "Enter Number!", vbInformation, "Contact Number"
Exit Sub
If txtDate = "" Then
MsgBox "Enter Date", vbInformation, "Date"
Exit Sub
If txtPNR = "" Then
MsgBox "Enter PNR", vbInformation, "PNR"
Exit Sub
If txtfgtno = "" Then
MsgBox "Enter Number!", vbInformation, "Flight Number"
Exit Sub
If txtfgtd = "" Then
MsgBox "Enter date", vbInformation, "Flight Date"
Exit Sub
If txtItinerary = "" Then
MsgBox "Enter itinerary", vbInformation, "Itinerary"
Exit Sub
If txtnoseats = "" Then
MsgBox "Enter Number!", vbInformation, "Number of Seats"
Exit Sub
If TxtDAPP = "" Then
MsgBox "Enter Amount", vbInformation, "Deposit Ammount Per Pax"
Exit Sub
If txtTDA = "" Then
MsgBox "Enter Amount!", vbInformation, "Total Deposit Ammount"
Exit Sub
Else
BlnVal = 1
End If
End Sub
I dont know where or what is wrong with the coding, can someone please highlight and correct my errors. Thank you
Bookmarks