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


Dim x As Integer
Dim OrigColor As Integer
Dim NewColor As Integer
Dim CellToFlash As Range
OrigC = ActiveCell.Interior.ColorIndex
NewColor = 16 ' 1st cell color
OrigColor = 2 ' 2nd cell color
Set CellToFlash = Range("L7") ' Cell range to flash
Do Until x = 5 ' Flash 20 times
DoEvents
start = Timer ' Set timer for 1st flash rate
Delay = start + 0.2 ' Set delay for 1st cell color
Do Until Timer Delay ' Dountil delay is exceeded = start+1
DoEvents
CellToFlash.Interior.ColorIndex = NewColor ' Changes cell color to
1st color
Loop
start = Timer ' Set timer for 2nd flash rate
Delay = start + 0.2 ' Set delay for 2nd cell color
Do Until Timer Delay
DoEvents
CellToFlash.Interior.ColorIndex = OrigColor ' Changes cell color to
2nd color
Loop
x = x + 1 ' Loop increment
Loop

The above VB makes cell "L7" flash the way I want it to.
How do I modify the above VB to make Label1 on UserForm1 flash
instead??


--
grahammal
------------------------------------------------------------------------
grahammal's Profile: http://www.excelforum.com/member.php...o&userid=20336
View this thread: http://www.excelforum.com/showthread...hreadid=526709

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Flashing UserForm Label

Private Sub CommandButton1_Click()
Dim x As Integer
Dim OrigColor As Long
Dim NewColor As Long
Dim CellToFlash As MSForms.Label
OrigC = ActiveCell.Interior.ColorIndex
NewColor = RGB(255, 0, 0) ' 1st cell color
OrigColor = Me.Label1.BackColor
Set CellToFlash = Me.Label1 ' Cell range to flash
Do Until x = 5 ' Flash 20 times
DoEvents
Start = Timer ' Set timer for 1st flash rate
Delay = Start + 0.2 ' Set delay for 1st cell color
Do Until Timer Delay ' Dountil delay is exceeded = start+1
DoEvents
CellToFlash.BackColor = NewColor ' Changes cell color to
Loop
Start = Timer ' Set timer for 2nd flash rate
Delay = Start + 0.2 ' Set delay for 2nd cell color
Do Until Timer Delay
DoEvents
CellToFlash.BackColor = OrigColor ' Changes cell color to
Loop
x = x + 1 ' Loop increment
Loop

End Sub

--
Regards,
Tom Ogilvy


"grahammal" wrote:


Dim x As Integer
Dim OrigColor As Integer
Dim NewColor As Integer
Dim CellToFlash As Range
OrigC = ActiveCell.Interior.ColorIndex
NewColor = 16 ' 1st cell color
OrigColor = 2 ' 2nd cell color
Set CellToFlash = Range("L7") ' Cell range to flash
Do Until x = 5 ' Flash 20 times
DoEvents
start = Timer ' Set timer for 1st flash rate
Delay = start + 0.2 ' Set delay for 1st cell color
Do Until Timer Delay ' Dountil delay is exceeded = start+1
DoEvents
CellToFlash.Interior.ColorIndex = NewColor ' Changes cell color to
1st color
Loop
start = Timer ' Set timer for 2nd flash rate
Delay = start + 0.2 ' Set delay for 2nd cell color
Do Until Timer Delay
DoEvents
CellToFlash.Interior.ColorIndex = OrigColor ' Changes cell color to
2nd color
Loop
x = x + 1 ' Loop increment
Loop

The above VB makes cell "L7" flash the way I want it to.
How do I modify the above VB to make Label1 on UserForm1 flash
instead??


--
grahammal
------------------------------------------------------------------------
grahammal's Profile: http://www.excelforum.com/member.php...o&userid=20336
View this thread: http://www.excelforum.com/showthread...hreadid=526709


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
Userform Label Steve[_9_] Excel Discussion (Misc queries) 7 October 29th 07 09:51 PM
Userform Label question David Goodall Excel Programming 2 October 29th 04 03:33 PM
Flashing worksheets behind a userform mworth01 Excel Programming 4 August 13th 04 03:41 PM
Userform blinking label Ed Excel Programming 2 July 17th 04 12:24 AM
UserForm label doesn't load? Ed[_18_] Excel Programming 4 June 21st 04 07:53 PM


All times are GMT +1. The time now is 12:37 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"