Validate Cell


D

Duncan

Hi

I have the code below. This applies to a large number of worksheets in a
workbook.

At the minute if no information is entered in cell E14 the Warning is
displayed and the macro stops.

What I am after is for only the following to be entered in cell E14 and then
the macro to call PrintandEmail.

I am trying to do this without usind the Data>Validation>Allow list on all
my worksheets.

00D
00E
00M
00C

Thanks

Sub Validate_PayGroup()
If Range("E14") = "" Then
MsgBox "A Paygroup Must Be Entered (00M, 00E, 00D or 00C)" & vbCr & vbCr _
& "PLEASE PRESS OK AND MAKE SURE A VALID PAY GROUP IS ENTERED", vbCritical,
"WARNING - PAYROLL MEMOS"
Else: Call PrintandEmail
End If
End Sub
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top