View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Message before print for specified worksheets

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
Select Case .Name
Case "trips", "statistic":
Msg = "Before print please insert to your printer paper
size:" & _
vbNewLine & "Legal (8 1/2 x 14 in)"
Title = "Warning TITLE"
Response = MsgBox(Msg, vbYesNo + vbQuestion, Title)
If Response = vbNo Then
Cancel = True
Exit Sub
End If
End Select
End With
End Sub


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"inta251 via OfficeKB.com" <u30987@uwe wrote in message
news:6e609b863e164@uwe...
On OfficeKB i found code

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Msg = "Warning message"
Title = "Warning TITLE"
Response = MsgBox(Msg, vbYesNo + vbQuestion, Title)
If Response = vbNo Then
Cancel = True
Exit Sub
End If
End Sub

This code for all workbook.
Need code for specified worksheets.
In my situation for now i have two worksheets 'trips' and 'statistic'
in the future may be more.
Where page setup paper size: Legal (8 1/2 x 14 in).
Messege will be: "Before print please insert to your printer paper size:
Legal (8 1/2 x 14 in)."

Thanks in advance.
Sincerely, Igor (inta251)

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200702/1