Maybe this quetion is to Dax and Ivan..how to make a cell flash and also how to make a picture do an
Posted by DUNNO on August 02, 2001 8:32 AM
please provide the code..TIA
Posted by Joe Was on August 02, 2001 9:42 AM
Animation code
This is a sample code macro. To look up the other msoAnination options use the help from the macro page. JSW
Sub Print_Inflation()
' This button prints the Inflation table from the Inflate sheet.
'
With Assistant
.On = True
.Visible = True
If Not Sounds Then Sounds = True
.Animation = msoAnimationBeginSpeaking
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("A1").Select
With Assistant
.On = True
.Visible = True
If Not Sounds Then Sounds = True
.Animation = msoAnimationPrinting
End With
End Sub
Posted by Joe Was on August 02, 2001 9:49 AM
Color Flash Code
Below is several sets of code to make different parts of a cell or range flash, the background, font ect. JSW
Sub FlashBack()
'Make cell range Background color, flash x times, x fast, in x color,
'when Ctrl-a is pressed, you must set this macro option.
Dim newColor As Integer
Dim myCell As Range
Dim x As Integer
Dim fSpeed
'Make this cell range background flash!
Set myCell = Range("A1:A2")
Application.DisplayStatusBar = True
Application.StatusBar = "... Select Cell to Stop and Edit or Wait for Flashing to Stop! "
'Make cell background flash to this color!
'Black 25, Magenta 26, Yellow 27, Cyan 28, Violet 29, Dark Red 30,
'Teal 31, Blue 32, White 2, Red 3, Light Blue 41, Dark Blue 11,
'Gray-50% 16, Gray-25% 15, Bright Cyan 8.
newColor = 27
'Make the cell range flash fast: 0.01 to slow: 0.99
fSpeed = 0.2
'Make cell flash, this many times!
Do Until x = 35
'Run loop!
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
Application.StatusBar = False
Application.DisplayStatusBar = Application.DisplayStatusBar
End Sub
Sub FlashFont()
'Make cell range font flash, x times, x fast, in x color,
'when Ctrl-z is pressed.
Dim newColor As Integer
Dim myCell As Range
Dim x As Integer
Dim fSpeed
'Make this cell range font flash!
Set myCell = Range("A1:A2")
Application.DisplayStatusBar = True
Application.StatusBar = "... Select Cell to Stop and Edit or Wait for Flashing to Stop! "
'Make cell font flash to this color!
'Black 25, Magenta 26, Yellow 27, Cyan 28, Violet 29, Dark Red 30,
'Teal 31, Blue 32, White 2, Red 3, Light Blue 41, Dark Blue 11,
'Gray-50% 16, Gray-25% 15, Bright Cyan 8.
newColor = 3
'Make the cell range flash fast: 0.01 to slow: 0.99
fSpeed = 0.3
'Make cell flash, this many times!
Do Until x = 20
'Run loop!
DoEvents
Start = Timer
Delay = Start + fSpeed
Do Until Timer > Delay
DoEvents
myCell.Font.ColorIndex = newColor
Loop
Start = Timer
Delay = Start + fSpeed
Do Until Timer > Delay
DoEvents
myCell.Font.ColorIndex = xlAutomatic
Loop
x = x + 1
Loop
Application.StatusBar = False
Application.DisplayStatusBar = Application.DisplayStatusBar
End Sub
Sub reSetFlash()
'Re-set cell range color if edit break on color, Ctrl-r to re-set!
ActiveCell.Select
Selection.Interior.ColorIndex = xlNone
End Sub
Posted by Joe Was on August 02, 2001 9:53 AM
Add color by condition
This will color by a cell condition it can be made to flash as well. JSW
Sub myAddColor()
' Add color if Range("B12:H22") greater than 0, if 0 remove color.
' By Joe Was
'
Range("B12:H22").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, _
Formula1:="0"
Selection.FormatConditions(1).Interior.ColorIndex = 8
Range("A1").Select
End Sub