Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Chip,
How can I rewrite the code below so that startblink does not start at the opening of the spreadsheet but rather starts as a result of cell A1 value = "Already Posted" ? And also I would like to be able to stop it at will, i.e., user acknowledges it is in "already posted" status and clicks a button to stop it... Please help. Thanks, Orlando Complete VBA Code Public RunWhen As Double Sub StartBlink() With ThisWorkbook.Worksheets("Sheet1").Range("A1").Font If .ColorIndex = 3 Then ' Red Text .ColorIndex = 2 ' White Text Else .ColorIndex = 3 ' Red Text End If End With RunWhen = Now + TimeSerial(0,0,1) Application.OnTime RunWhen, "'" & ThisWorkbook.Name & "'!StartBlink", , True End Sub Sub StopBlink() ThisWorkbook.Worksheets("Sheet1").Range("A1").Font .ColorIndex = _ xlColorIndexAutomatic Application.OnTime RunWhen, "'" & ThisWorkbook.Name & "'!StartBlink", , False End Sub Then, in the ThisWorkbook code module of the workbook, use code like: Private Sub Workbook_Open() StartBlink End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) StopBlink End Sub -- Orlando Vazquez "Chip Pearson" wrote: If you really want blinking text (which I find highly annoying) you need to use a VBA function. Excel itself doesn't support blinking text. See http://www.cpearson.com/Excel/BlinkingText.aspx for code examples. Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Wed, 17 Dec 2008 08:20:07 -0800, Melissa wrote: So this is probably something that should be very simple, but it's giving me a headache. I use excel at my job to keep track of stuff that needs to be picked up. The value of this cell is manually inputted whenever it changes, Excel doesn't calculate the value in any way. If there's 2, I input two. If it's 0, I put in 0. What I want it to do is blink if the value I input is greater than 0. All the codes I've found only work if the cell value is being calculated by Excel, or it effects more than just this particular cell. The cell used is J1. I want the color of the background to remain the same grey color, and if it's 0 the text is a light grey, if it's 1 or greater the text blinks between grey and bright red. Can anyone help me? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
blinking cell | Excel Discussion (Misc queries) | |||
Blinking Cell | Excel Discussion (Misc queries) | |||
Blinking cell | Excel Discussion (Misc queries) | |||
Blinking Cell | Excel Programming | |||
blinking cell? | Excel Programming |