Posted to microsoft.public.excel.misc
|
|
Printing with restrictions - VB
Take a look at the solution I posted in .programming. Change the range to
...Range("K11,K26,D29")
In article ,
pgarcia wrote:
Cool, what if the cells are in different areas, sorry, should have said that
in the first msg.
Cell
K11
K26
D29 ect.
"Ron de Bruin" wrote:
Hi pgarcia
You can copy this event in the thisworkbook module
http://www.rondebruin.nl/code.htm
It will only print if all three cells have a value
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
If Application.WorksheetFunction.CountA(.Range("A1:C1 ")) < 3 Then
MsgBox "Please fill in A1:C1"
Cancel = True
Else
'Allow printing
End If
End With
End Sub
--
Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm
"pgarcia" wrote in message
...
Hello again,
I looking to do the following; if cell A1, B1, and C1 are blank (no data)
then do not allow to print sheet. Given an error and indicate what
cell(s) or
name of cell(s) needs to be filled.
Thanks
|