How can I check 2 cells?

A

Aversin

How can i check Cells D1 and C2 to see if there is a anything written i
them? (notes)

I would like to check D1 first, and if it is empty check c2, and i
both are empty I will pop up a message box, but if either one of the
have something in them then, I dont want to pop up the messag
box.....

I hope all of that makes sense:)

thank
 
F

Frank Kabel

Hi
do you need a messagebox (so a VBA solution). If yes you may try:
sub check_it()
dim ret_value
with activesheet
application.counta(.range("D1"),.range("C2"))
end with
if ret_value=0 then
msgbox "no value in either cell"
end if
end sub
 
Top