unique macro

Copper Contributor

Is it possible to write a macro that causes a cell value to flash or blink if the cell value fails to meet a maximum or minimum value?

8 Replies

@aggie_aguirre5260 

Instead of flashing or blinking (which can be dangerous for some users, and irritating to others), you can use conditional formatting to make the cell stand out - you can change the cell's font style, fill color and/or borders.

I appreciate your suggestion, but I prefer to have the cell value flashing or blinking. That is more "eye-catching" than simply changing font and/or cell color. BTW, I'm the only one that will be using the spreadsheet, so there isn't a concern that it would be dangerous or irritating to others. So, my question still stands, is my preference possible?

@aggie_aguirre5260 

It's possible, but I still strongly recommend against it. It would require VBA code to run every second or so, and this will most likely interfere with the normal operation of the workbook.

@HansVogelaar 

I will heed your advice.  However, just for my curiosity, what would the macro look like?  If it's not unreasonable to send it, can you send it to me?

@aggieaguirre 

See the attached demo workbook. There is code in three places:

  • In the standard module Module1
  • In the worksheet module of Sheet1
  • In the workbook module ThisWorkbook

One of the side effects that you'll notice is that you'll be asked to save the workbook each time you close it even if you didn't change anything.

I appreciate your advice and for sending the macro. If I elect to put this on my sheet (just to see how it would look), will I have to write the respective codes on each of the three places you mentioned?

@aggieaguirre

Yes.

Change the values of the constants dblMin and dblMax for your situation, and change the function rngCell to return the cell that you want to flash. These are all in Module1.

This is awesome. Thank you so much for sharing your knowledge and time.