bloodmilksky
Board Regular
- Joined
- Feb 3, 2016
- Messages
- 202
Hi Guys,
This is my first real attempt at writing some code. I think I have got everything right but keeps on coming up with a Compile Error Block If End IF.
Can anyone help ?
MAny thanks
Jamie
This is my first real attempt at writing some code. I think I have got everything right but keeps on coming up with a Compile Error Block If End IF.
Can anyone help ?
Code:
Dim daysremaining As Integer, daystaken As Integer, result As String, myValue As Variantdaystaken = Range("B13").Value
daysremaining = Range("D14").Value
If daysremaining <= 1 Then
Msg = " You Do Not Have Enough Holiday! Would You Like To Continue ? " & Application.UserName
Ans = MsgBox(Msg, vbYesNo)
If Ans = vbNo Then
Application.DisplayAlerts = False
ThisWorkbook.Save
Application.DisplayAlerts = True
Application.Quit
End If
If Ans = vbYes Then
Sheets("Request Form").Select
Range("Employee3").ClearContents
Range("DateRequest").ClearContents
Range("Employee3") = Application.UserName
End If
If daystaken >= 25 Then
Msg = " You Do Not Have Enough Holiday! Would You Like To Continue ? " & Application.UserName
Ans = MsgBox(Msg, vbYesNo)
If Ans = vbNo Then
Application.DisplayAlerts = False
ThisWorkbook.Save
Application.DisplayAlerts = True
Application.Quit
End If
If Ans = vbYes Then
Sheets("Request Form").Select
Range("Employee3").ClearContents
Range("DateRequest").ClearContents
Range("Employee3") = Application.UserName
Else
NewBookingCheck.NewBookingCheck
End If
End If
End Sub
MAny thanks
Jamie