Thread
:
Printing with restrictions - VB
View Single Post
#
7
Posted to microsoft.public.excel.misc
Don Guillett
external usenet poster
Posts: 10,124
Printing with restrictions - VB
It was tested. Did you put in the ThisWorkbook module? Did you change
sheet26 to conform?
Was your focus on the sheet at the time? If not, change to suit your
desires.
As mentioned by JE. Pls post in ONLY ONE group from now on
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"pgarcia" wrote in message
...
Sorry, that did not work. Please advise. Thanks
"Don Guillett" wrote:
Put this in the ThisWorkbook module. Change sheet name to suit.
It accounts for the "dreaded space bar"
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name < "Sheet26" Then Exit Sub
If Len(Application.Trim(Range("a1"))) < 1 _
Or Len(Application.Trim(Range("b1"))) < 1 _
Or Len(Application.Trim(Range("c1"))) < 1 Then
MsgBox "Fill in a1:c1"
Cancel = True
End If
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"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
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett