![]() |
|
|
|
#1
|
|||
|
|||
|
Is there a way for a textbox or label caption to blink between text and backcolour? |
|
#2
|
|||
|
|||
|
excel - Flashing/ blinking a textbox with one command button - Stack Overflow
Code:
Option Explicit
Public dteStartTime As Date
Sub start_time()
Application.OnTime Now + TimeValue("00:00:01"), "next_moment"
End Sub
Sub end_time()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:01"), "next_moment", , False
On Error GoTo 0
End Sub
Sub next_moment()
If Worksheets("Sheet1").Cells(1, 1).Interior.ColorIndex = 6 Then
Worksheets("Sheet1").Cells(1, 1).Interior.ColorIndex = 0
Else
Worksheets("Sheet1").Cells(1, 1).Interior.ColorIndex = 6
End If
If dteStartTime + TimeValue("00:00:10") <= Now Then
end_time
Else
start_time
End If
End Sub
Sub CommandButton1_Click()
dteStartTime = Now
Call start_time
End Sub
|
|
#3
|
|||
|
|||
|
Thanks Logit.
This code is for an excel spreadsheet. I was looking for code which is compatible with ms word? Thanks |
|
#4
|
||||
|
||||
|
Much of the code is the same for Word and Excel but, since you haven't provided any details about what kind of textbox you're referring to (people call all sorts of things in Word textboxes) or how it is to be identified, it's impossible to code a solution for your specific situation. Obviously, too, whatever the textbox is, it's liable to require different code from that used for a caption. You also haven't told us anything about when this flashing is supposed to occur.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#5
|
|||
|
|||
|
My apologies.
I though it was simple. Here is the code I wrote Quote:
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with Extraction of Text in 1 TextBox only | Cendrinne | Word VBA | 4 | 11-14-2021 09:55 PM |
| Blink/flicker Option button (ActiveX control) while Scrolling Up/Down pages | Shabbyexcel | Word VBA | 0 | 12-28-2020 07:25 AM |
| wrapping text around a picture within a textbox | ketanco | Word | 3 | 04-06-2016 11:07 AM |
| Cells That Blink | jdc15371 | Excel | 3 | 12-06-2013 02:10 AM |
Display result in textbox based on the input of another textbox
|
scarymovie | Word VBA | 5 | 05-16-2012 07:05 PM |