Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I am looking for a code that will do the following: Before printing look for... If D17 0 then D28 must be 0 AND If F17 0 then F28 must be 0 If one of these conditions is not met then a message box would appear and cancel printing. Any help or reference material is appreciated. Thanks! -- shikamikamoomoo ------------------------------------------------------------------------ shikamikamoomoo's Profile: http://www.excelforum.com/member.php...o&userid=21018 View this thread: http://www.excelforum.com/showthread...hreadid=472205 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
shikamikamoomoo,
Put the code below into the codemodule of the Thisworkbook object. Change the sheet name to reflect the sheet on which you want to base your control of printing. HTH, Bernie MS Excel MVP Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim sh As Worksheet Set sh = Worksheets("Sheet1") With sh If Not (IIf(sh.Range("D17").Value 0, _ IIf(sh.Range("D28").Value 0, True, False), True) And _ (IIf(sh.Range("F17").Value 0, _ IIf(sh.Range("F28").Value 0, True, False), True))) Then MsgBox "You can't print until they're all greater than zero....." Cancel = True Exit Sub End If End With End Sub "shikamikamoomoo" <shikamikamoomoo.1w6u6e_1128110730.1072@excelfor um-nospam.com wrote in message news:shikamikamoomoo.1w6u6e_1128110730.1072@excelf orum-nospam.com... I am looking for a code that will do the following: Before printing look for... If D17 0 then D28 must be 0 AND If F17 0 then F28 must be 0 If one of these conditions is not met then a message box would appear and cancel printing. Any help or reference material is appreciated. Thanks! -- shikamikamoomoo ------------------------------------------------------------------------ shikamikamoomoo's Profile: http://www.excelforum.com/member.php...o&userid=21018 View this thread: http://www.excelforum.com/showthread...hreadid=472205 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks worked great. -- shikamikamoomoo ------------------------------------------------------------------------ shikamikamoomoo's Profile: http://www.excelforum.com/member.php...o&userid=21018 View this thread: http://www.excelforum.com/showthread...hreadid=472205 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Format dollar amounts for check printing | Excel Discussion (Misc queries) | |||
Format dollar amounts for check printing | Excel Discussion (Misc queries) | |||
Check Box Printing | Excel Discussion (Misc queries) | |||
why do check boxes move when printing excel spreadhseets | Excel Discussion (Misc queries) | |||
Check box moves after printing | Excel Discussion (Misc queries) |