How can I check 2 cells?

  • Thread starter Thread starter Aversin
  • Start date Start date
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
 
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
 

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

Back
Top