Hello, I am attempting to create an error message msgbox in an Excel workbook/worksheet. I have the coding to create the msgbox but if the error is on the worksheet multiple times, it shows the error multiple times. I have tried using alreadyprompted coding to stop this action but I'm having no luck. Additionally, I would like the error message to show a 'critical' icon on the error message and that is also not working. I would appreciate any help you can give. Here is the coding that I have so far:
Private Sub ProjNumbrReq()
Static alreadyPrompted As Boolean
If alreadyPrompted Then Exit Sub
Dim myCell As Range
With Worksheets("Travel Expense Voucher")
For Each myCell In .Range("U15:U45")
If myCell.Value > 0 And .Cells(myCell.row, "N") = "" Then
MsgBox "Project Number must be provided on each line where reimbursement is being claimed.", vbInformation, "Important:"
alreadyPrompted = True
End If
Next myCell
End With
End Sub
Private Sub ProjNumbrReq()
Static alreadyPrompted As Boolean
If alreadyPrompted Then Exit Sub
Dim myCell As Range
With Worksheets("Travel Expense Voucher")
For Each myCell In .Range("U15:U45")
If myCell.Value > 0 And .Cells(myCell.row, "N") = "" Then
MsgBox "Project Number must be provided on each line where reimbursement is being claimed.", vbInformation, "Important:"
alreadyPrompted = True
End If
Next myCell
End With
End Sub