How could I make the contents of a Cell "Flash" like a warning.

H

Héctor Miguel

there is a wise-tricky procedure (posted by KL in spanish ng sometime ago)...
(and with minor changes based on Thomas Jansen -1999- post)...
that lets you to preserve the undo-levels, and you might want to give it a try...

if any doudbts (or further information)... would you please comment ?
hth,
hector.

assuming a cell es (B1) and you need it to flash if its value is greater than 5

1) select B1... (menu) format / conditional format...
(formula): =(b1>5)*(mod(second(now()),2)=0)
(format): apply formats as needed/wished/...

2) copy/paste the following code-lines:
===
a) in a general code module:
===
Option Private Module
Public Sequence As Date
Sub StartBlinking()
Sequence = Now + TimeSerial(0, 0, 1)
Worksheets(1).Range("b1").Calculate ' modify/adapt/... worksheets index/name as appropriate
Application.OnTime Sequence, "StartBlinking"
End Sub
Sub StopBlinking()
On Error Resume Next
Application.OnTime Sequence, "StartBlinking", Schedule:=False
End Sub
===
b) in ThisWorkbook code module:
===
Private Sub Workbook_Open()
StartBlinking
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
StopBlinking
End Sub
 
R

ryguy7272

Put this in Cell B20:
Hello World!! This is animated text!!!

Run this code in a conventional module:
Sub ANIM()
st = " " & Range("B20") & " "
i = 0
While True
Range("B21").Value = Mid(st, i Mod Len(st) + 1, 10)
For j = 1 To 300000
k = k + 1
Next j
i = i + 1
Wend
End Sub


Regards,
Ryan---
 
R

Ranjit kurian

Hi Hector,

is it possible to use the below code to my user form 'Label', and it should
blink only for 1 minute and 5 seconds
 
H

Héctor Miguel

hi, Ranjit !
is it possible to use the below code to my user form 'Label'
and it should blink only for 1 minute and 5 seconds

you could try with smething like this code (when the userform is showed/activated/initialized/...)
note: while code is looping... code is looping (other code and actions step into stand-by mode)...

Private Sub UserForm_Activate()
Dim ShowTime As Single
ShowTime = Timer + 10
Do While ShowTime > Timer
If (ShowTime - Timer) Mod 2 = 0 Then
Label1.BackColor = QBColor(4)
Label1.ForeColor = QBColor(14)
Else
Label1.BackColor = QBColor(14)
Label1.ForeColor = QBColor(4)
End If
Me.Repaint
Loop
Label1.BackColor = &H8000000F
Label1.ForeColor = &H80000012
End Sub

hth,
hector.

__ OP __
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top