Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Flashing cells

Hi, i wanted to have several cells were if the value reaches a certain amout
a third cell will slowly flash, the code below works to some extent but not
properly, cell A1 flashes blue when H1 is higher in value than G1, but i
wanted cell B1 to flash if I1 was greater than J1 and so on, but it doesn't
work correctly, the top half of the code takes presidence over the later half.

Any ideas were i have gone wrong?

Mnay thanks for any help.

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("H1") ("G1") Then
Beep
Dim newColor As Integer
Dim myCell As Range
Dim x As Integer
Dim fSpeed
Set myCell = Range("A1")
newColor = 41
fSpeed = 0.5
Do Until x = 10
DoEvents
Start = Timer
Delay = Start + fSpeed
Do Until Timer Delay
DoEvents
myCell.Interior.ColorIndex = newColor
Loop
Start = Timer
Delay = Start + fSpeed
Do Until Timer Delay
DoEvents
myCell.Interior.ColorIndex = xlNone
Loop
x = x + 1
Loop
Else
If Range("I1") Range("J1") Then
Beep
Set myCell = Range("B1")
newColor = 24
fSpeed = 0.5
Do Until x = 10
DoEvents
Start = Timer
Delay = Start + fSpeed
Do Until Timer Delay
DoEvents
myCell.Interior.ColorIndex = newColor
Loop
Start = Timer
Delay = Start + fSpeed
Do Until Timer Delay
DoEvents
myCell.Interior.ColorIndex = xlNone
Loop
x = x + 1
Loop
Else
Application.StatusBar = False
Application.DisplayStatusBar = Application.DisplayStatusBar
Application.EnableEvents = True
End If
End If
End Sub
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Flashing cells MAX Excel Programming 5 May 6th 09 09:01 PM
Cells flashing MAX Excel Programming 2 May 6th 09 07:35 AM
flashing cells MAX Excel Worksheet Functions 0 April 27th 09 10:12 PM
Flashing cells MAX Excel Worksheet Functions 3 April 27th 09 04:55 PM
Flashing Cells Jim333[_10_] Excel Programming 9 September 10th 05 11:28 AM


All times are GMT +1. The time now is 01:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"