Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default fill in cell before printing / saving

I have looked at previous posts and the codes given have not worked.

Is there a way to stop a user from printing an excel sheet before filling in
specific areas? If not I need help with the code associated with not saving
before filling it out. Help?


--
Karissa
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default fill in cell before printing / saving

Place this subroutine in a workbook module (not a general module)

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Range("Sheet3!C10") = "" Then
Cancel = True
MsgBox "No tax value entered into C10"
End If
End Sub

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Karissa" wrote in message
...
I have looked at previous posts and the codes given have not worked.

Is there a way to stop a user from printing an excel sheet before filling
in
specific areas? If not I need help with the code associated with not
saving
before filling it out. Help?


--
Karissa



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default fill in cell before printing / saving

Ok, so this may be one of my issues: I am not sure the difference between
workbook module and general module. I have been putting the code in "This
workbook" and nothing happens. Any guidance?
--
Karissa


"Bernard Liengme" wrote:

Place this subroutine in a workbook module (not a general module)

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Range("Sheet3!C10") = "" Then
Cancel = True
MsgBox "No tax value entered into C10"
End If
End Sub

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Karissa" wrote in message
...
I have looked at previous posts and the codes given have not worked.

Is there a way to stop a user from printing an excel sheet before filling
in
specific areas? If not I need help with the code associated with not
saving
before filling it out. Help?


--
Karissa




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default fill in cell before printing / saving

You have the right module. What version of Excel are you using? What is
your macro security setting? Are you opening the file with macros enabled?
Are you sure that you had the ThisWorkbook module on the screen when you
pasted the macro into it? You must double-click "ThisWorkbook" to access
that module. HTH Otto
"Karissa" wrote in message
...
Ok, so this may be one of my issues: I am not sure the difference between
workbook module and general module. I have been putting the code in "This
workbook" and nothing happens. Any guidance?
--
Karissa


"Bernard Liengme" wrote:

Place this subroutine in a workbook module (not a general module)

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Range("Sheet3!C10") = "" Then
Cancel = True
MsgBox "No tax value entered into C10"
End If
End Sub

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Karissa" wrote in message
...
I have looked at previous posts and the codes given have not worked.

Is there a way to stop a user from printing an excel sheet before
filling
in
specific areas? If not I need help with the code associated with not
saving
before filling it out. Help?


--
Karissa






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default fill in cell before printing / saving

Right-click on the Excel Icon left of "File" or left end of Title Bar if
sheet window not maximized,

Select "View Code" and paste the code into that module............which is
Thisworkbook module.

Alt + q to return to Excel window.

Hit Print button.

If the range is empty or a formula returns "" the code should cancel the
print job and pop up the msgbox.


Gord Dibben MS Excel MVP

On Mon, 8 Dec 2008 12:39:00 -0800, Karissa
wrote:

Ok, so this may be one of my issues: I am not sure the difference between
workbook module and general module. I have been putting the code in "This
workbook" and nothing happens. Any guidance?
--
Karissa


"Bernard Liengme" wrote:

Place this subroutine in a workbook module (not a general module)

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Range("Sheet3!C10") = "" Then
Cancel = True
MsgBox "No tax value entered into C10"
End If
End Sub

best wishes




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default fill in cell before printing / saving


I am using excel 2003 its on medium security

I keep getting a run time error : run time error'1004':method 'range'of
object_Global'failed.

otherwise all I did was cut and paste this code just to test it for sheet3:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Range("Sheet3!C10") = "" Then
Cancel = True
MsgBox "No tax value entered into C10"
End If
End Sub

I appreciate your help


--
Karissa


"Gord Dibben" wrote:

Right-click on the Excel Icon left of "File" or left end of Title Bar if
sheet window not maximized,

Select "View Code" and paste the code into that module............which is
Thisworkbook module.

Alt + q to return to Excel window.

Hit Print button.

If the range is empty or a formula returns "" the code should cancel the
print job and pop up the msgbox.


Gord Dibben MS Excel MVP

On Mon, 8 Dec 2008 12:39:00 -0800, Karissa
wrote:

Ok, so this may be one of my issues: I am not sure the difference between
workbook module and general module. I have been putting the code in "This
workbook" and nothing happens. Any guidance?
--
Karissa


"Bernard Liengme" wrote:

Place this subroutine in a workbook module (not a general module)

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Range("Sheet3!C10") = "" Then
Cancel = True
MsgBox "No tax value entered into C10"
End If
End Sub

best wishes



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default fill in cell before printing / saving


I figured it out...spaced the fact that I named the tabs and it was no longer
sheet3
dumb user mistake. Thank you for your help!!

--
Karissa


"Gord Dibben" wrote:

Right-click on the Excel Icon left of "File" or left end of Title Bar if
sheet window not maximized,

Select "View Code" and paste the code into that module............which is
Thisworkbook module.

Alt + q to return to Excel window.

Hit Print button.

If the range is empty or a formula returns "" the code should cancel the
print job and pop up the msgbox.


Gord Dibben MS Excel MVP

On Mon, 8 Dec 2008 12:39:00 -0800, Karissa
wrote:

Ok, so this may be one of my issues: I am not sure the difference between
workbook module and general module. I have been putting the code in "This
workbook" and nothing happens. Any guidance?
--
Karissa


"Bernard Liengme" wrote:

Place this subroutine in a workbook module (not a general module)

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Range("Sheet3!C10") = "" Then
Cancel = True
MsgBox "No tax value entered into C10"
End If
End Sub

best wishes



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
Saving as PDF and printing in a macro Mia Excel Programming 0 June 17th 08 08:23 AM
Printing and saving problems Andrew H Excel Discussion (Misc queries) 1 August 7th 07 07:53 PM
How do I force a user to fill in all cells in excel before saving tomtomtomtomtom Excel Discussion (Misc queries) 1 August 16th 05 06:35 PM
Excel printing problem - won't print cell under a "fill effect" bo dmotika Excel Discussion (Misc queries) 0 May 26th 05 04:38 PM
Printing and saving file. Prasad Vanka Excel Programming 0 May 26th 04 11:01 AM


All times are GMT +1. The time now is 12:12 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"