Kristen_cancerkiller
Member
I have the following code set to give an error message one time if the following requirements are met, however, I forgot that I need to include that this need only run if field F5 is equal to 2. Can someone tell me how I would include that without breaking the rest of my code?
Code:
Private Sub ProjNumbrReq()
'If there is a value greater than 0 in U for this row, and column n for this row
'is blank, and employee has been selected, then show an error message that a project number must be entered or no
'reimbursement will be given.
Static alreadyPrompted As Boolean
Dim myCell As Range
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.", vbCritical, "Important:"
Exit Sub
End If
Next myCell
End With
End Sub
Private Sub ProjNumbrReq()
'If there is a value greater than 0 in U for this row, and column n for this row
'is blank, and employee has been selected, then show an error message that a project number must be entered or no
'reimbursement will be given.
Static alreadyPrompted As Boolean
Dim myCell As Range
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.", vbCritical, "Important:"
Exit Sub
End If
Next myCell
End With
End Sub
Last edited by a moderator: