Help!

VBA and Printing

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Printing RSS
Next:  Creating a task request inside a form  
Author Message
Djllaber



Joined: May 30, 2007
Posts: 1



PostPosted: Wed May 30, 2007 3:56 pm    Post subject: VBA and Printing

Hi,

I am trying to get Excel to validate before printing a worksheet.

When I hit print, I want it to check cell H8... If its value is 0 it can print.

If it is not 0 (>0) I want a prompt to say "Hey!!! It ain't 0" or words to that effect, with the option to print anyway, or cancel print.

Any idea...

I have _beforeprint (cancel as blah blah blah) but I have no idea what to put where when or how.

Thanks!!!
Back to top
kkc97



Joined: Aug 15, 2007
Posts: 4



PostPosted: Wed Oct 03, 2007 10:57 am    Post subject: Re: VBA and Printing [Login to view extended thread Info.]

In the BeforePrint procedure, try this:

dim CheckH8 as integer

If H8 = 0 then
"print command"
Else
CheckH8 = msgbox("Hey!!! It ain't 0", vbOKCancel,"Put caption of msgbox here")
End If


You might have to put it in the On Print procedure if it doesn't work there.
Good luck. Smile
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Printing All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum