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 TextBox


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.
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=526707

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

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.
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=526707


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
Highlight all Text in a Textbox when the textbox is selected RPIJG[_73_] Excel Programming 3 October 28th 05 08:28 PM
HELP! I Lost The Ability To Advance From TextBox To TextBox With the ENTER Or The TAB Keys Minitman[_4_] Excel Programming 0 February 22nd 05 08:50 PM
Textbox Bug? Missing/delayed update of textbox filled via VBA MarcM Excel Programming 0 November 4th 04 05:47 PM
Textbox Bug? Missing/delayed update of textbox filled via VBA MarcM Excel Programming 0 November 4th 04 05:43 PM
How to move cursor from one textbox control to another textbox con KMoore007 Excel Programming 0 September 16th 04 02:47 PM


All times are GMT +1. The time now is 05:10 AM.

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"