Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 31
Default Message before print for specified worksheets

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

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 31
Default Message before print for specified worksheets

Thanks for respond.
Code working perfect.
THANKS again.
Sincerely, Igor (inta251)

--
Message posted via http://www.officekb.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Print Message Box Connie Excel Discussion (Misc queries) 0 October 19th 06 03:25 PM
How do I print a workbook in but only print selected worksheets? Karl S. Excel Discussion (Misc queries) 1 August 31st 06 12:34 AM
How to print when an error message keeps showing? clueless Excel Discussion (Misc queries) 1 January 30th 06 05:33 PM
Trouble printing message 'print to file' beaner Excel Discussion (Misc queries) 0 January 26th 06 11:18 PM
Trouble printing message 'print to file' beaner Excel Discussion (Misc queries) 0 January 26th 06 11:16 PM


All times are GMT +1. The time now is 11:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"