View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Beto[_3_] Beto[_3_] is offline
external usenet poster
 
Posts: 140
Default Data validation on print - need code

seeker < wrote:

I need a way to initiate data validation when the user tries to print
the document.

E.g., cell R1C1 requires input. If user tries to print document,
message box appears and tells them to fill in this cell first.


There is a Before Print event in the workbook.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Range("A1")="" Then
Msgbox "You must fill A1 first"
Cancel = True
End If
End Sub

This code of course must be placed in the Workbook module.
Regards,
--
Beto
Reply: Erase between the dot (inclusive) and the @.
Responder: Borra la frase obvia y el punto previo.