Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
2007: How to disable printing when a specific cell is blank
Hello,
I am trying to disable all printing when a specific cell on a worksheet is blank. Meaning there is no way a user can print anything from the worksheet until the cell has been filled. Any code samples or examples would be both appreciated and helpful. This example needs to work for Excel 2007, working for any other versions is a bonus. Thanks for the help in advance, Aaron |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
2007: How to disable printing when a specific cell is blank
Hi Aaron
add this to your Workbook module Private Sub Workbook_BeforePrint(Cancel As Boolean) If Range("A1") = "" Then MsgBox ("STOP") Cancel = True End If End Sub HTH Trevor Williams "Aaron" wrote: Hello, I am trying to disable all printing when a specific cell on a worksheet is blank. Meaning there is no way a user can print anything from the worksheet until the cell has been filled. Any code samples or examples would be both appreciated and helpful. This example needs to work for Excel 2007, working for any other versions is a bonus. Thanks for the help in advance, Aaron |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
2007: How to disable printing when a specific cell is blank
Hey Trevor,
This worked well! Thanks alot for the help. Aaron "Trevor Williams" wrote: Hi Aaron add this to your Workbook module Private Sub Workbook_BeforePrint(Cancel As Boolean) If Range("A1") = "" Then MsgBox ("STOP") Cancel = True End If End Sub HTH Trevor Williams "Aaron" wrote: Hello, I am trying to disable all printing when a specific cell on a worksheet is blank. Meaning there is no way a user can print anything from the worksheet until the cell has been filled. Any code samples or examples would be both appreciated and helpful. This example needs to work for Excel 2007, working for any other versions is a bonus. Thanks for the help in advance, Aaron |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
2007: How to disable printing when a specific cell is blank
No worries.
Thanks for the feedback. "Aaron" wrote: Hey Trevor, This worked well! Thanks alot for the help. Aaron "Trevor Williams" wrote: Hi Aaron add this to your Workbook module Private Sub Workbook_BeforePrint(Cancel As Boolean) If Range("A1") = "" Then MsgBox ("STOP") Cancel = True End If End Sub HTH Trevor Williams "Aaron" wrote: Hello, I am trying to disable all printing when a specific cell on a worksheet is blank. Meaning there is no way a user can print anything from the worksheet until the cell has been filled. Any code samples or examples would be both appreciated and helpful. This example needs to work for Excel 2007, working for any other versions is a bonus. Thanks for the help in advance, Aaron |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
2007: How to disable printing when a specific cell is blank
However, I have one more question and Im not sure if this should be another
post or not... Would it be possible to do stop printing if the cell is blank but still be able to view the print preview? Thanks, Aaron "Trevor Williams" wrote: Hi Aaron add this to your Workbook module Private Sub Workbook_BeforePrint(Cancel As Boolean) If Range("A1") = "" Then MsgBox ("STOP") Cancel = True End If End Sub HTH Trevor Williams "Aaron" wrote: Hello, I am trying to disable all printing when a specific cell on a worksheet is blank. Meaning there is no way a user can print anything from the worksheet until the cell has been filled. Any code samples or examples would be both appreciated and helpful. This example needs to work for Excel 2007, working for any other versions is a bonus. Thanks for the help in advance, Aaron |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
2007: How to disable printing when a specific cell is blank
Hmmm, that's a good question. Give me 5 mins and I'll try and suss it out.
"Aaron" wrote: However, I have one more question and Im not sure if this should be another post or not... Would it be possible to do stop printing if the cell is blank but still be able to view the print preview? Thanks, Aaron "Trevor Williams" wrote: Hi Aaron add this to your Workbook module Private Sub Workbook_BeforePrint(Cancel As Boolean) If Range("A1") = "" Then MsgBox ("STOP") Cancel = True End If End Sub HTH Trevor Williams "Aaron" wrote: Hello, I am trying to disable all printing when a specific cell on a worksheet is blank. Meaning there is no way a user can print anything from the worksheet until the cell has been filled. Any code samples or examples would be both appreciated and helpful. This example needs to work for Excel 2007, working for any other versions is a bonus. Thanks for the help in advance, Aaron |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
2007: How to disable printing when a specific cell is blank
Sorry Aaron - probably best to post it as a new question as it's not a 5 min
job (for me at least). Should be possible though as just need to catch what event triggered the beforeprint module. (printout or printpreview) Trevor "Aaron" wrote: However, I have one more question and Im not sure if this should be another post or not... Would it be possible to do stop printing if the cell is blank but still be able to view the print preview? Thanks, Aaron "Trevor Williams" wrote: Hi Aaron add this to your Workbook module Private Sub Workbook_BeforePrint(Cancel As Boolean) If Range("A1") = "" Then MsgBox ("STOP") Cancel = True End If End Sub HTH Trevor Williams "Aaron" wrote: Hello, I am trying to disable all printing when a specific cell on a worksheet is blank. Meaning there is no way a user can print anything from the worksheet until the cell has been filled. Any code samples or examples would be both appreciated and helpful. This example needs to work for Excel 2007, working for any other versions is a bonus. Thanks for the help in advance, Aaron |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
2007: How to disable printing when a specific cell is blank
Ok, still I really appreciate the time, help and effort you have offered.
Thanks for that. I have reposted my question with the added print preview requirement. Thanks again!, Aaron "Trevor Williams" wrote: Sorry Aaron - probably best to post it as a new question as it's not a 5 min job (for me at least). Should be possible though as just need to catch what event triggered the beforeprint module. (printout or printpreview) Trevor "Aaron" wrote: However, I have one more question and Im not sure if this should be another post or not... Would it be possible to do stop printing if the cell is blank but still be able to view the print preview? Thanks, Aaron "Trevor Williams" wrote: Hi Aaron add this to your Workbook module Private Sub Workbook_BeforePrint(Cancel As Boolean) If Range("A1") = "" Then MsgBox ("STOP") Cancel = True End If End Sub HTH Trevor Williams "Aaron" wrote: Hello, I am trying to disable all printing when a specific cell on a worksheet is blank. Meaning there is no way a user can print anything from the worksheet until the cell has been filled. Any code samples or examples would be both appreciated and helpful. This example needs to work for Excel 2007, working for any other versions is a bonus. Thanks for the help in advance, Aaron |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
2007: How to disable printing when a specific cell is blank
Aaron and Trevor, This is exactly what I am looking to do, however when looking at Aaron's directions I am not sure where to input this information. I am also using excel 2007. Can you point me in the right direction of where I need to insert this information? Thank you, Rebecca *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cell blank when printing | Excel Discussion (Misc queries) | |||
How to disable printing a specific worksheet? | Excel Worksheet Functions | |||
How to disable printing a specific worksheet? | Excel Worksheet Functions | |||
Disable Printing If Cell Empty | Excel Programming | |||
Printing if a cell is blank | Excel Programming |