PDA

View Full Version : Flashing Cell



pokenose
05-29-2008, 04:23 AM
Hi Guys,

I am in the process of creating a spreadsheet which gives an different textual outcomes on a particular cell. The possible out comes are:
Stop
Go
Stay
Cut
I would like this cell to be flashing with the above outcome in different colours. eg: Stop to be flashing in red colour cell, go to be flashing in green colour cell and stay to be flashing in yellow coloured cell etc.
Is there a coding that you guys can help me with which will make this easy. Thanks in advance.

Nouman

grichey
05-29-2008, 05:49 AM
Something along these lines might be the right direction.
Dim counter As Integer
counter = 1
Range("A1:A1").Select
Do
If (Selection = "GO") Then
Selection.Interior.ColorIndex = 4
Application.Wait Now() + TimeValue("00:00:01")
End If
If (Selection = "Stop") Then
Selection.Interior.ColorIndex = 3
Application.Wait Now() + TimeValue("00:00:01")
End If

If (Selection = "Stay") Then
Selection.Interior.ColorIndex = 6
Application.Wait Now() + TimeValue("00:00:01")
End If

If (Selection = "Stop") Then
Selection.Interior.ColorIndex = 8
Application.Wait Now() + TimeValue("00:00:01")
End If

Selection.Interior.ColorIndex = 0
Application.Wait Now() + TimeValue("00:00:01")
Loop Until counter <> 1

Bob Phillips
05-29-2008, 06:06 AM
I would strongly advise you not to do this.

In the first instance, it will annoy people, and annoyed people do not make good users.

In the second instance, it some countries/states, it may even be illegal under the terms of disabled persons legislation.

grichey
05-29-2008, 06:21 AM
Hmm -- apart from the annoying factor, as a matter of practice, how do you get a result like this? I don't know how to make something just run in the background like this example.

pokenose
05-29-2008, 06:21 AM
Gavin - Thanks for your code but I am a beginner. Will this be the coding to be inserted in VB by pressing ALT+F11 or in the edit coding of the cell?

grichey
05-29-2008, 08:33 AM
Mine doesn't work exactly right. This code just would run at running of the macro not on the change in the word in the cell. It would need to go in a module in the editor (alt f11). Right click insert module.