Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This has been driving me crazy!
I have msgbox code validating data in both my before_print and before_save modules; the code is identical in both (except for some slight text changes in the message boxes). When I save the document the message box pops up and closes correctly; when I print/print preview the message box pops up, allows you to click the "OK" button, but remains on the screen and doesn't allow you to close it (either with the red x button or by clicking OK again). The only way I've figured to get around it is to manually run another macro that plugs in dummy data where I've had the code validate. Below is one of the msgbox sections, as I said before both the before_save and before_print modules are identical. The idea is if a checkbox is selected (in this case, biotaarrowcheck1) then data must be entered in at least one of the cells in the range (h37:n37). If data is not entered, the message box pops up and cancels the save/print, cancels the procedure, and goes away. It would be nice if it could select a range at the end (.range("h37").select), but when I added that to the procedure beforesave didn't work at all. Thank you for all your help, I've been wrestling with this for a while. With worksheets("human health csm") 'Tests Ingestion of Wild Foods row If .BiotaArrowCheck1.value = True Then If Application.CountA(.range("h37:n37")) < 1 Then MsgBox ("Please enter the current and/or future receptors in the Ingestion of Wild Foods row." & vbNewLine & "Your action has been cancelled.") Cancel = True End End If End If End With |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
BeforePrint | Excel Programming | |||
BeforePrint help | Excel Programming | |||
BeforePrint Add In | Excel Programming | |||
ADO 2.7 & ADO 2.8 beforeprint | Excel Programming | |||
Help with BeforePrint | Excel Programming |