How to highlight a cell when its content is changed?

dikken20

Board Regular
Joined
Feb 25, 2009
Messages
130
Office Version
  1. 2010
Platform
  1. Windows
Hello,

I would like to highlight a cell in yellow background for half a second when its content is changed.

Is it possible?

Thanks :)
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Hi Dikken

This is 1 second
Change the 5 to another color index you like
Please note, this must go in the sheet module you re wanting to affect: double clicking on Sheet1(Sheet1)

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
OgColor = Target.Interior.ColorIndex
Target.Interior.ColorIndex = 5
Application.Wait (Now + TimeValue("0:00:01"))
Target.Interior.ColorIndex = og

End Sub
 
Upvote 0
Hi Dikken

This is 1 second
Change the 5 to another color index you like
Please note, this must go in the sheet module you re wanting to affect: double clicking on Sheet1(Sheet1)

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
OgColor = Target.Interior.ColorIndex
Target.Interior.ColorIndex = 5
Application.Wait (Now + TimeValue("0:00:01"))
Target.Interior.ColorIndex = og

End Sub
That is a nice answer. It works for me. I have never use Application.wait.
 
Upvote 0
@EFANYoutube
There's a typo in your code when you reset the colour back to it's original state.
 
Upvote 0
@EFANYoutube
There's a typo in your code when you reset the colour back to it's original state.
Hi Fluff
Thanks for the pickup

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
OgColor = Target.Interior.ColorIndex
Target.Interior.ColorIndex = 5
Application.Wait (Now + TimeValue("0:00:01"))
Target.Interior.ColorIndex = OgColor

End Sub
 
Upvote 0
Hi Fluff
Thanks for the pickup

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
OgColor = Target.Interior.ColorIndex
Target.Interior.ColorIndex = 5
Application.Wait (Now + TimeValue("0:00:01"))
Target.Interior.ColorIndex = OgColor

End Sub
Thank you so much for the reply.

Yet, I've just copied the code to the right sheet and it works only for manual cell modification. Yet, for cells that modified by DDE link (from a third party application) it doesn't work (I reason I need it is specific for a notification of the cell that modified by the third party application.

Is there maybe solution for this?
 
Upvote 0
Hmm. That little nugget was not in your original post but if it is not triggering, it means that you 3rd party application may need to trigger it
I don't have any experence with DDE so i can't help sorry but I get what your tiring to do and it's going to look pretty cool when you get it working
 
Upvote 0
Hmm. That little nugget was not in your original post but if it is not triggering, it means that you 3rd party application may need to trigger it
I don't have any experence with DDE so i can't help sorry but I get what your tiring to do and it's going to look pretty cool when you get it working
Yes..
It is a trading system while I'm using it's data on my sheet via DDE.
Since I'm getting like bazillion info every millisecond I need to get this highlighting done to get my attention.
I hope there's any other option to make it trigger.
Thanks for your major help though!
 
Upvote 0

Forum statistics

Threads
1,214,801
Messages
6,121,644
Members
449,045
Latest member
Marcus05

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top