# Flashing Cell Background

#### snichols

##### New Member
I realize that there have been numerous posts about this question and I have read through almost all of them, however, I cannot seem to get any of them to work. I will first admit that I know next to nothing about using macros with excel, but here is what I would like to accomplish.

Cell E5 is a value that must be entered manually and it must meet the following criteria, it must be a multiple of 6 and it must be >= to 54 and <= 192. That part is easy!

Now merged cells G5:M5 have the following formula,

=IF(AND(MOD(E5,6)=0,E5>=54,E5<=192),"WALL HEIGHT O.K.",IF(AND(MOD(E5,6)>0,E5>=54,E5<=192),"ERROR! WALL HEIGHT MUST BE IN 6" INCREMENTS!",IF(AND(MOD(E5,6)>=0,E5<54),"ERROR! WALL HEIGHT MUST BE 4'-6" MINIMUM","ERROR! WALL HEIGHT MUST BE 16'-0" MAXIMUM!")))

This formula works fine for the text, however the Big Boss Man would like it to have more of a visual impact if the person enters data that is not within the set parameters. I would like to be able to have the background be Green and not flash if the First IF statement is met "WALL HEIGHT O.K.", if either of the ERROR statements are met I would like to have the background flash Red, is this possible and if so could you be very explicit as to how to go about it. Thanks in advance for any help!

### Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

#### erik.van.geit

##### MrExcel MVP
Hi, here my point of view:

Instead of allowing mistakes and then flash cells, couldn't you validate your E5-cell?
=AND(MOD(E5,6) = 0,E5>=54,E5 <= 192)
if you put this in the formulabox of "custom" validation

kind regards,
Erik

#### snichols

##### New Member
Erik,
I like your idea and I added it to the cell, but the Boss wanted something that told the user why the data was incorrect, hence the Error message in the merged cells. I would still like to have the background flash red if the data is incorrect, I also appreciate the other replies, but you must have missed the part about me not knowing squat about macros. I am sure those macros would probably work, but I have no idea how to adapt them to my problem.
Thanks to all!!

#### erik.van.geit

##### MrExcel MVP
Hello,

In fact you can tell the user what's wrong: just go to the other TABS in the validationbox. NO code needed.

If you nevertheless still are obliged to use macros, I hope the guys who gave you the links will help you further, cause my time is limited at the moment.
To use code:
start the Visual Basic Editor (via Menu Tools, Macro or press ALT+F11).
On the Insert menu in the VBE, click Module. (if necessary)
In the module (the white area at the right), paste the code there.

kind regards,
Erik

Replies
1
Views
1K
Replies
10
Views
443
Replies
1
Views
314
Replies
2
Views
836
Replies
6
Views
206

1,181,165
Messages
5,928,471
Members
436,603
Latest member
regismaltais

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back