Warning message if one column contains any text and another column is blank

D

Dileep Chandran

Hello everybody,

How can I get a warning message, if I enter any text in A1 and left B1
blank and proceeded to C1?

Appreciate any help in advance

Thanks

DC
 
I

Ian

Hi DC

One option is to set a conditional format in C1.

eg Formula Is =AND(A1<>"",B1="") and set Format>Patterns to a background
colour.
 
D

Dave F

One possibility is a graphical warning, applied with conditional formatting.

Example: if you want to be alerted whenever B1 remains blank you could apply
to C1 the following conditional formatting:

Format--Conditional Formatting

Condition 1: Formula is: =ISBLANK(B1) and have the color displayed a bright,
garish color.

If you want an actual dialogue box to pop up, with a text message telling
you that B1 is blank, then you would have to write some code.

Dave
 
B

Bernard Liengme

Select the B cells in question
Use Format | Conditional Formatting
Use Formula is: =AND(NOT(ISBLANK(A1)),ISBLANK(B1), NOT(ISBLANK(C1)))
and set a pattern (bright red?)
If A and C are not blank while B is the cell with have a bright colour.
Any good?
 
D

Dileep Chandran

Thats good enough. Thank you. But is it possible to get a pop up
warning for that, using a macro?
 
D

Dileep Chandran

I think, my question is not clear. I am looking for a pop up message,
like what we get if the cell has a data validation.

Anyway, thank you for all your help
 
J

Jonathan

Hi Dileep, I've got the nearest thing for you without requiring coding, using
Data Validation.

Set your validation in Cell C1 as 'Custom' and use the same code as
mentioned earlier: =AND(A1<>"",B1="") and ensure the tickbox "ignore blank"
is unticked.

Simply use the 'error message' tab to create something like: "Ensure you
type in cell A & B" and that should present you with an error dialogue box
you were after :)

Hope that was ok.

Jonathan
 
J

Jonathan

Sorry that should have been: =AND(A1<>"",B1<>"")

Jonathan said:
Hi Dileep, I've got the nearest thing for you without requiring coding, using
Data Validation.

Set your validation in Cell C1 as 'Custom' and use the same code as
mentioned earlier: =AND(A1<>"",B1="") and ensure the tickbox "ignore blank"
is unticked.

Simply use the 'error message' tab to create something like: "Ensure you
type in cell A & B" and that should present you with an error dialogue box
you were after :)

Hope that was ok.

Jonathan
 
D

Dileep Chandran

The idea of giving validation is pretty good. Thanks.
But the formula is not working for me.

The formula should be like, If A1 is not blank, B1 is blank, we could
not be able enter any text in C1.

Is my question clear now?.

Thanks
Dileep
 
I

Ian

This should do as the data validation formula if you only want C1 enabled
when both A1 & B1 have data.

=AND(ISBLANK(A1)=FALSE,ISBLANK(B1)=FALSE)
 
D

Dileep Chandran

Thanks Ian. Its working fine.

Thank you all for the support given to sort out this issue.

-Dileep
 
Top