ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Is it possible to make a cell flash between 2 colours? (https://www.excelbanter.com/excel-worksheet-functions/62618-possible-make-cell-flash-between-2-colours.html)

barry24uk

Is it possible to make a cell flash between 2 colours?
 
I think the question speaks for itself.

Gary''s Student

Is it possible to make a cell flash between 2 colours?
 
You might try an OnTime Event procedure to alternately change a cell's
background color back and forth. But it would not blink very fast.

See http://cpearson.com/excel/ontime.htm for help on OnTime.

_____________________________________
Gary's Student


"barry24uk" wrote:

I think the question speaks for itself.


Desert Piranha

Is it possible to make a cell flash between 2 colours?
 

barry24uk Wrote:
I think the question speaks for itself.

Hi Barry,
Try this, cange to suit your needs
'----------
Public Sub Blink()
Dim appTime
With Sheets(1).Range("A1").Interior
If .ColorIndex = 4 Then
.ColorIndex = 3
Else
.ColorIndex = 4
End If
End With
appTime = Now() + TimeValue("00:00:01")
Application.OnTime appTime, "Blink"
End Sub
'----------


--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=497233


ikr

Is it possible to make a cell flash between 2 colours?
 
"Desert Piranha"
<Desert.Piranha.20yu2m_1136135402.5753@excelforu m-nospam.com wrote in
message news:Desert.Piranha.20yu2m_1136135402.5753@excelfo rum-nospam.com...

barry24uk Wrote:
I think the question speaks for itself.

Hi Barry,
Try this, cange to suit your needs
'----------
Public Sub Blink()
Dim appTime
With Sheets(1).Range("A1").Interior
If .ColorIndex = 4 Then
ColorIndex = 3
Else
ColorIndex = 4
End If
End With
appTime = Now() + TimeValue("00:00:01")
Application.OnTime appTime, "Blink"
End Sub
'----------


dot missing from the beginning of the ColorIndex = 3 and ColorIndex = 4
lines, to link with the With statement, viz:
..ColorIndex = 3
....
..ColorIndex = 4



Desert Piranha

Is it possible to make a cell flash between 2 colours?
 

ikr Wrote:
"Desert Piranha"
<Desert.Piranha.20yu2m_1136135402.5753@excelforu m-nospam.com wrote in
message
news:Desert.Piranha.20yu2m_1136135402.5753@excelfo rum-nospam.com...

barry24uk Wrote:
I think the question speaks for itself.

Hi Barry,
Try this, cange to suit your needs
'----------
Public Sub Blink()
Dim appTime
With Sheets(1).Range("A1").Interior
If .ColorIndex = 4 Then
ColorIndex = 3
Else
ColorIndex = 4
End If
End With
appTime = Now() + TimeValue("00:00:01")
Application.OnTime appTime, "Blink"
End Sub
'----------


dot missing from the beginning of the ColorIndex = 3 and ColorIndex =
4
lines, to link with the With statement, viz:
..ColorIndex = 3
....
..ColorIndex = 4Hi ikr,

Don't know, but in my post there are dots in front of them.
Maybe whatever you are using to view with, is not picking them up.
I should have put tags around the code.


--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=497233


ikr

Is it possible to make a cell flash between 2 colours?
 
"Desert Piranha"
<Desert.Piranha.20z94a_1136154901.8541@excelforu m-nospam.com wrote in
message news:Desert.Piranha.20z94a_1136154901.8541@excelfo rum-nospam.com...

ikr Wrote:
"Desert Piranha"
<Desert.Piranha.20yu2m_1136135402.5753@excelforu m-nospam.com wrote in
message
news:Desert.Piranha.20yu2m_1136135402.5753@excelfo rum-nospam.com...

barry24uk Wrote:
I think the question speaks for itself.
Hi Barry,
Try this, cange to suit your needs
'----------
Public Sub Blink()
Dim appTime
With Sheets(1).Range("A1").Interior
If .ColorIndex = 4 Then
ColorIndex = 3
Else
ColorIndex = 4
End If
End With
appTime = Now() + TimeValue("00:00:01")
Application.OnTime appTime, "Blink"
End Sub
'----------


dot missing from the beginning of the ColorIndex = 3 and ColorIndex =
4
lines, to link with the With statement, viz:
..ColorIndex = 3
....
..ColorIndex = 4Hi ikr,

Don't know, but in my post there are dots in front of them.
Maybe whatever you are using to view with, is not picking them up.
I should have put tags around the code.

I'm using Outlook Express



barry24uk

Is it possible to make a cell flash between 2 colours?
 
Sorry. I should have told you that the cell I want to flash between the 2
colours already contains an IF formula
=IF(S28<=0," ",IF(N28=P9," ",IF(N28<P9,"Replace Your Clone")))
There is also a Conditional format linked to the cell as well.


"Desert Piranha" wrote:


barry24uk Wrote:
I think the question speaks for itself.

Hi Barry,
Try this, cange to suit your needs
'----------
Public Sub Blink()
Dim appTime
With Sheets(1).Range("A1").Interior
If .ColorIndex = 4 Then
.ColorIndex = 3
Else
.ColorIndex = 4
End If
End With
appTime = Now() + TimeValue("00:00:01")
Application.OnTime appTime, "Blink"
End Sub
'----------


--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=497233




All times are GMT +1. The time now is 02:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com