ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   macros for print (https://www.excelbanter.com/excel-discussion-misc-queries/253602-macros-print.html)

hitesh

macros for print
 
i read somwere in Dicsussion Group Post.
If Cell A1 Contain "Print", then Document should Print.If A1 is blank print
will not work.

pls help.

Gord Dibben

macros for print
 
In Thisworkbook module.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveWorkbook.Sheets("Sheet1").Range("A1") < "Print" Then
MsgBox "Cannot print"
Cancel = True
End If
End Sub


Gord Dibben MS Excel MVP

On Sat, 16 Jan 2010 07:26:01 -0800, hitesh
wrote:

i read somwere in Dicsussion Group Post.
If Cell A1 Contain "Print", then Document should Print.If A1 is blank print
will not work.

pls help.



hitesh

macros for print
 
its not working, iam using excel 2007

"Gord Dibben" wrote:

In Thisworkbook module.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveWorkbook.Sheets("Sheet1").Range("A1") < "Print" Then
MsgBox "Cannot print"
Cancel = True
End If
End Sub


Gord Dibben MS Excel MVP

On Sat, 16 Jan 2010 07:26:01 -0800, hitesh
wrote:

i read somwere in Dicsussion Group Post.
If Cell A1 Contain "Print", then Document should Print.If A1 is blank print
will not work.

pls help.


.


Gord Dibben

macros for print
 
This is not a macro you "run".

It is event code which is triggered by you selecting the Print Icon or
FilePrint.


Gord

On Sat, 16 Jan 2010 22:21:01 -0800, hitesh
wrote:

its not working, iam using excel 2007

"Gord Dibben" wrote:

In Thisworkbook module.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveWorkbook.Sheets("Sheet1").Range("A1") < "Print" Then
MsgBox "Cannot print"
Cancel = True
End If
End Sub


Gord Dibben MS Excel MVP

On Sat, 16 Jan 2010 07:26:01 -0800, hitesh
wrote:

i read somwere in Dicsussion Group Post.
If Cell A1 Contain "Print", then Document should Print.If A1 is blank print
will not work.

pls help.


.




All times are GMT +1. The time now is 03:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com