ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Flashing Cells (Like stock quotes) (https://www.excelbanter.com/excel-programming/330605-re-flashing-cells-like-stock-quotes.html)

Bob Phillips[_7_]

Flashing Cells (Like stock quotes)
 
Seeing as you are adamant, I just did and came up with this

http://tinyurl.com/847u7

--
HTH

Bob Phillips

"Carlton Patterson" wrote in message
...
Thanks Bob,

I'll check out google and see if I can find something.

Cheers

Carlton

*** Sent via Developersdex http://www.developersdex.com ***




Carlton Patterson

Flashing Cells (Like stock quotes)
 
Thanks Bob,

I'm going to check out the links in Google.

Cheers

P.S.

Is there any reason why I didn't get a notification email letting me
know that you replied to my request?

*** Sent via Developersdex http://www.developersdex.com ***

Carlton Patterson

Flashing Cells (Like stock quotes)
 
Bob,

I couldn't really find what I was looking for on the Google link you
submitted. May be I just wasn't explaining myself properly. So, what I
would like is the following.

I would like to apply conditional formatting but the effect
to appear when my condition to be fulfilled should be
either or all of the below mentioned
1) Flashing cell for say 5 secs to highlight that cell
has changed, pretty much like a live stock quote
screen

2) Continuos blinking of the cell

3) Playing a sound when the condition is fulfilled

I hope someone can help me achieve this.

Cheers

Carlton

*** Sent via Developersdex http://www.developersdex.com ***

Bob Phillips[_7_]

Flashing Cells (Like stock quotes)
 
Carl,

I can't see you getting that with conditional formatting. As far as I am
aware, flashing has to be obtained with VBA, and so you couldn't use a
worksheet function, not even a UDF, which is what CF relies on.

--
HTH

Bob Phillips

"Carlton Patterson" wrote in message
...
Bob,

I couldn't really find what I was looking for on the Google link you
submitted. May be I just wasn't explaining myself properly. So, what I
would like is the following.

I would like to apply conditional formatting but the effect
to appear when my condition to be fulfilled should be
either or all of the below mentioned
1) Flashing cell for say 5 secs to highlight that cell
has changed, pretty much like a live stock quote
screen

2) Continuos blinking of the cell

3) Playing a sound when the condition is fulfilled

I hope someone can help me achieve this.

Cheers

Carlton

*** Sent via Developersdex http://www.developersdex.com ***




Carlton Patterson

Flashing Cells (Like stock quotes)
 
So, you don't think you can help me?

Carlton


*** Sent via Developersdex http://www.developersdex.com ***

Bob Phillips[_7_]

Flashing Cells (Like stock quotes)
 
Well actually I think I can, bit convoluted, as long as the condition will
be met by a cell change.

First, define a new Style (Format / Style / Flash/ Add ) and apply that
style to the cell(s) you want to flash.

then add this code to a standard code module

Option Explicit

Dim nStart As Date

Sub Flash()
Static cTimes As Long
cTimes = cTimes + 1
If cTimes = 10 Then
With ActiveWorkbook.Styles("Flash")
.Font.ColorIndex = xlColorIndexAutomatic
End With
Else
nStart = Now + TimeValue("00:00:01")
With ActiveWorkbook.Styles("Flash")
If .Font.ColorIndex = 3 Then
.Font.ColorIndex = xlColorIndexAutomatic
.Interior.ColorIndex = xlColorIndexNone
Else
.Font.ColorIndex = 3
.Interior.ColorIndex = 19
.Interior.Pattern = xlSolid
End If
End With
Application.OnTime nStart, "Flash"
End If
End Sub


and this to the worksheet in wuestion


Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("H10")) Is Nothing Then
Flash
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


But don't you dare tell anyone I gave you a flashing text soluition
otherwise I'm coming after you :-)


Bob

"Carlton Patterson" wrote in message
...
So, you don't think you can help me?

Carlton


*** Sent via Developersdex http://www.developersdex.com ***




Bob Phillips[_7_]

Flashing Cells (Like stock quotes)
 
Correction

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("H10")) Is Nothing Then
cTimes = 0
Flash
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


and

Option Explicit

Dim nStart As Date
Public cTimes As Long

Sub Flash()
cTimes = cTimes + 1
If cTimes = 10 Then
With ActiveWorkbook.Styles("Flash")
.Font.ColorIndex = xlColorIndexAutomatic
End With
Else
nStart = Now + TimeValue("00:00:01")
With ActiveWorkbook.Styles("Flash")
If .Font.ColorIndex = 3 Then
.Font.ColorIndex = xlColorIndexAutomatic
.Interior.ColorIndex = xlColorIndexNone
Else
.Font.ColorIndex = 3
.Interior.ColorIndex = 19
.Interior.Pattern = xlSolid
End If
End With
Application.OnTime nStart, "Flash"
End If
End Sub


--
HTH

Bob Phillips

"Bob Phillips" wrote in message
...
Well actually I think I can, bit convoluted, as long as the condition will
be met by a cell change.

First, define a new Style (Format / Style / Flash/ Add ) and apply that
style to the cell(s) you want to flash.

then add this code to a standard code module

Option Explicit

Dim nStart As Date

Sub Flash()
Static cTimes As Long
cTimes = cTimes + 1
If cTimes = 10 Then
With ActiveWorkbook.Styles("Flash")
.Font.ColorIndex = xlColorIndexAutomatic
End With
Else
nStart = Now + TimeValue("00:00:01")
With ActiveWorkbook.Styles("Flash")
If .Font.ColorIndex = 3 Then
.Font.ColorIndex = xlColorIndexAutomatic
.Interior.ColorIndex = xlColorIndexNone
Else
.Font.ColorIndex = 3
.Interior.ColorIndex = 19
.Interior.Pattern = xlSolid
End If
End With
Application.OnTime nStart, "Flash"
End If
End Sub


and this to the worksheet in wuestion


Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("H10")) Is Nothing Then
Flash
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


But don't you dare tell anyone I gave you a flashing text soluition
otherwise I'm coming after you :-)


Bob

"Carlton Patterson" wrote in message
...
So, you don't think you can help me?

Carlton


*** Sent via Developersdex http://www.developersdex.com ***






Carlton Patterson

Flashing Cells (Like stock quotes)
 
Bob,

I haven't had a chance to check it out yet, however I have every
confidence its going to work.

You're the best!!

Cheers mate.

Carlton

P.S.

I hope one day I'll be able to help you out....

*** Sent via Developersdex http://www.developersdex.com ***

Carlton Patterson

Flashing Cells (Like stock quotes)
 
Hey Bob,

You're a star. It works like a dream.

Cheers mate.

Carlton

*** Sent via Developersdex http://www.developersdex.com ***

Carlton Patterson

Flashing Cells (Like stock quotes)
 
Hi Bob,

I don't know if you're around, however I wanna say thanks again for the
program.

I was wondering if you could help me tweak the program a little bit?

I tried to modify the program so that I could get more than one cell to
flash independently by changing the following line:

If Not Intersect(Target, Me.Range("H10")) Is Nothing Then

To

If Not Intersect(Target, Me.Range("H10", "H11")) Is Nothing Then

However, when one cell changes they both flash. I would prefer if the
cell that changes to flash.

Cheers

Carlton

P.S. I hope I've explained myself well.

*** Sent via Developersdex http://www.developersdex.com ***

Carlton Patterson

Flashing Cells (Like stock quotes)
 
Hi all,

Just in case any one wants to help me, I'm trying to modify the original
program to allow me to select a range of cells and have those cells
flash independently of each other.

Any help will be greatly appreciated.

Cheers

Carlton


*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 08:30 PM.

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