Home |
Search |
Today's Posts |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perhaps
Private Sub Workbook_BeforePrint(Cancel As Boolean) Const sPWORD As String = "autpbg1" Dim ws As Worksheet Dim vCheck As Variant Dim i As Long Dim nAddr As Long Dim nMsg As Long vCheck = Array( _ Array("K7", "a date in 'Request Date' field"), _ Array("K11", _ "to choose a Mgr. from the 'Mgr. Approval' dropdown list"), _ Array("K14", _ "an amount in the 'Total Amount to be Reallocated' field"), _ Array("D26", "a number in the 'Receipt Number'")) nAddr = LBound(vCheck) nMsg = nAddr + 1 With Sheets("Receipt to Receipt") For i = LBound(vCheck) To UBound(vCheck) Cancel = Trim(.Range(vCheck(i)(nAddr)).Text) = vbNullString If Cancel Then MsgBox "You need " & vCheck(i)(nMsg) & _ " before printing!" Exit For End If Next i If Not Cancel Then .Unprotect Password:=sPWORD With .Range("A18:C18, A19:S48, G6:S15,N5:S5") .Interior.ColorIndex = xlColorIndexNone On Error Resume Next Application.EnableEvents = False .Parent.PrintOut Application.EnableEvents = True On Error GoTo 0 .Interior.ColorIndex = 37 End With .Protect Password:=sPWORD End If End With Cancel = True End Sub In article , pgarcia wrote: Sir, could you help me with one more thing? Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Restrictions in format | Excel Discussion (Misc queries) | |||
RESTRICTIONS | Excel Discussion (Misc queries) | |||
Printing with restrictions - VB | Excel Discussion (Misc queries) | |||
How to do look up with restrictions | Excel Discussion (Misc queries) | |||
get_Range Restrictions.. | Excel Programming |