Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
Cell blank when printing ckrogers Excel Discussion (Misc queries) 1 May 2nd 09 05:49 AM
How to disable printing a specific worksheet? Efzed Excel Worksheet Functions 1 February 21st 07 05:43 PM
How to disable printing a specific worksheet? William Horton Excel Worksheet Functions 0 February 21st 07 02:12 PM
Disable Printing If Cell Empty Rob Excel Programming 10 September 9th 06 05:08 PM
Printing if a cell is blank Martin Excel Programming 1 January 7th 05 03:25 PM


All times are GMT +1. The time now is 09:28 AM.

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"