Ok you are asking the user to select a cell to stop the macro.
So at the top of your module declare a public variable
Public StopFlag as Integer
Sub Auto_Open()
StopFlag = 0
End Sub
Now you need to Set the Stop Flag
so right click on the sheet name at the bottom of excel and select view code
paste this code there.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
StopFlag = 1
End Sub
Now modify your code .
Sub FlashBack()
Dim newColor As Integer
Dim myCell As Range
Dim x As Integer
Dim fSpeed
StopFlag = 0
Set myCell = ActiveCell
Application.DisplayStatusBar = True
Application.StatusBar = "... Select Cell to Stop and Edit or Wait for Flashing to Stop! "
newColor = 27
fSpeed = 0.5
Do Until x = 20
DoEvents
Start = Timer
Delay = Start + fSpeed
Do Until Timer > Delay
If StopFlag = 1 then exit Sub
DoEvents
myCell.Interior.ColorIndex = newColor
Loop
Start = Timer
Delay = Start + fSpeed
Do Until Timer > Delay
If StopFlag = 1 then exit Sub
DoEvents
myCell.Interior.ColorIndex = xlNone
Loop
x = x + 1
Loop
Application.StatusBar = False
Application.DisplayStatusBar = Application.DisplayStatusBar
End Sub
Bookmarks