Hi,

Can anyone help me on this problem.

I need to repeat the input if user click cancel or enter value not it selection criteria. Here is my VBA code but got error

sub data()
Dim NewStaff As Boolean

DoItAgain:
NewStaff = Application.InputBox("Is there any new staff to be updated?" & vbCrLf & vbCrLf & "Press Y, (Yes)" & vbCrLf & "Press N, (No)")

    If NewStaff = "Y" Or NewStaff = "y" Then
        
        Call XXXXXXXXX
    
    ElseIf NewStaff = "N" Or NewStaff = "n" Then
        
       Workbooks("workbookname").Close
    
    ElseIf NewStaff = Empty Then
        
        MsgBox ("Please do not press cancel")
        GoTo DoItAgain
    End If

end sub