Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-30-2022, 05:15 AM
JustLearnin JustLearnin is offline Textbox to blink once between backcolour and text Windows 10 Textbox to blink once between backcolour and text Office 2019
Novice
Textbox to blink once between backcolour and text
 
Join Date: Mar 2020
Posts: 5
JustLearnin is on a distinguished road
Default Textbox to blink once between backcolour and text

Is there a way for a textbox or label caption to blink between text and backcolour?
Reply With Quote
  #2  
Old 07-30-2022, 07:45 AM
Logit Logit is offline Textbox to blink once between backcolour and text Windows 10 Textbox to blink once between backcolour and text Office 2007
Expert
 
Join Date: Jan 2017
Posts: 529
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

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
Reply With Quote
  #3  
Old 08-01-2022, 03:45 AM
JustLearnin JustLearnin is offline Textbox to blink once between backcolour and text Windows 10 Textbox to blink once between backcolour and text Office 2019
Novice
Textbox to blink once between backcolour and text
 
Join Date: Mar 2020
Posts: 5
JustLearnin is on a distinguished road
Default

Thanks Logit.
This code is for an excel spreadsheet.
I was looking for code which is compatible with ms word?
Thanks
Reply With Quote
  #4  
Old 08-01-2022, 06:41 AM
macropod's Avatar
macropod macropod is offline Textbox to blink once between backcolour and text Windows 10 Textbox to blink once between backcolour and text Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by JustLearnin View Post
This code is for an excel spreadsheet.
I was looking for code which is compatible with ms word?
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]
Reply With Quote
  #5  
Old 08-01-2022, 04:11 PM
JustLearnin JustLearnin is offline Textbox to blink once between backcolour and text Windows 10 Textbox to blink once between backcolour and text Office 2019
Novice
Textbox to blink once between backcolour and text
 
Join Date: Mar 2020
Posts: 5
JustLearnin is on a distinguished road
Default

My apologies.
I though it was simple.
Here is the code I wrote
Quote:
Private Sub TextBox1_Change()
If Me.TextBox1 > "" Then
Change
End If
End Sub

Sub Change()
Dim i As Long

For i = 1 To 2
Application.OnTime when:=Now() + TimeValue("0:00:1")
TextBox2.BackColor = vbRed
Application.OnTime when:=Now() + TimeValue("0:00:1")
TextBox2.BackColor = vbGreen


Next i


End Sub
Reply With Quote
Reply

Thread Tools
Display Modes


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
Textbox to blink once between backcolour and text Display result in textbox based on the input of another textbox scarymovie Word VBA 5 05-16-2012 07:05 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:01 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft