ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Blinking Label (https://www.excelbanter.com/excel-programming/302801-re-blinking-label.html)

Nigel

Blinking Label
 
Not a good idea to create blinking text but if you must then try using the
OnTime method to control the flash.
This method shedules a procedure to occur at a specified moment so if you
use....Call the turnon procedure to start the flash (perhaps in the form
initialise event) and stop it by using the Schedule:=False option, refer to
on line help for details.

This is not a good idea!!

sub turnoff()
Userform1.Label13.Visible = False
Application.OnTime Now + TimeValue("00:00:01"), "turnon"
end sub

sub turnon()
Userform1.Label13.Visible = True
Application.OnTime Now + TimeValue("00:00:01"), "turnoff"
end sub


Cheers
Nigel

"dcstech" wrote in message
...
I have a label in a userform that I would like to blink. I am using a Do

While Loop to do this and it works. The problem is that the userform acts
like it is locked up and will not except any input. Here is my code. Thanks
for any help.

dcstech

Do While TextBox3.Text = ""
Label13.Visible = True
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 1
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Label13.Visible = False
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 1
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Loop





All times are GMT +1. The time now is 09:19 PM.

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