View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Karissa Karissa is offline
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