ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   print function in excel (https://www.excelbanter.com/excel-programming/357178-print-function-excel.html)

jatman

print function in excel
 
i have a template made and working mostly fine but i need two things and
unfortunately i do not know codes and stuff.

on the first three tabs (sheet1, sheet2, sheet3), i do not want them to
print - at all;

on the last tab, (sheet4). i only want that to print if two conditions are
met. the first, is a date value and i had help getting that set up but i no
longer have contact information of the person on this group that helped fix
that problem for me. the date value works fine.

the second condition on sheet4 that must be true before it prints is cell D7
must be 0 before it prints.

i tried to just add a line to the date macro but i do not think it is as
easy as i had hoped.

if any one can help,

thank you,

jatman


Tom Ogilvy

print function in excel
 
Post the code you have that is working. Probably a BeforePrint macro.

--
Regards,
Tom Ogilvy

"jatman" wrote in message
...
i have a template made and working mostly fine but i need two things and
unfortunately i do not know codes and stuff.

on the first three tabs (sheet1, sheet2, sheet3), i do not want them to
print - at all;

on the last tab, (sheet4). i only want that to print if two conditions

are
met. the first, is a date value and i had help getting that set up but i

no
longer have contact information of the person on this group that helped

fix
that problem for me. the date value works fine.

the second condition on sheet4 that must be true before it prints is cell

D7
must be 0 before it prints.

i tried to just add a line to the date macro but i do not think it is as
easy as i had hoped.

if any one can help,

thank you,

jatman




jatman

print function in excel
 
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "DSR" Then
Cancel = True
Application.EnableEvents = False
With ActiveSheet
If .Range("D1") < "[Ctrl] ;" Then
.PrintOut
End If
End With
Application.EnableEvents = True
End If
End Sub

jat

"Tom Ogilvy" wrote:

Post the code you have that is working. Probably a BeforePrint macro.

--
Regards,
Tom Ogilvy

"jatman" wrote in message
...
i have a template made and working mostly fine but i need two things and
unfortunately i do not know codes and stuff.

on the first three tabs (sheet1, sheet2, sheet3), i do not want them to
print - at all;

on the last tab, (sheet4). i only want that to print if two conditions

are
met. the first, is a date value and i had help getting that set up but i

no
longer have contact information of the person on this group that helped

fix
that problem for me. the date value works fine.

the second condition on sheet4 that must be true before it prints is cell

D7
must be 0 before it prints.

i tried to just add a line to the date macro but i do not think it is as
easy as i had hoped.

if any one can help,

thank you,

jatman






All times are GMT +1. The time now is 01:55 PM.

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