Check cell contents before print

N

nobbyknownowt

Hello there

I have written a spreadsheet that requires certain information to be
entered in certain cells to acheive the desired result.
It will total as it goes along so that if a celll is left blank the
result though incorrect would still be printed.
I have a macro button on the sheet to print the sheet.
Is it possible for me to have this button check there is data in cells
C1(A date) G1 (text) K1 (list) C2 (text) G2 (text) K2 (text) O2 (list)
I11 (num) I13 (num) O8:O16 (num) and G51 (text)

Heres hoping

Cheers
Nobby
 
P

Paul B

Nobby, you could use something like this,

Sub test()
Dim Cel As Range
For Each Cel In [C1:C2,G1:G2,K1:K2,O2, I11,I13,O8:O13,G51]
If IsEmpty(Cel) Then
Cel.Select
MsgBox "Data Missing", vbExclamation, "Can't Print Without All Data"
Exit Sub
End If
Next Cel

' ****Put your print code here*****

End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
P

Paul B

Your welcome, thanks for the feedback

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top