#1   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 390
Default Code help

Will you please tell me what I have wrong with this code?

In Workbook:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
stopFlashing
End Sub

Private Sub Workbook_Open()
startFlashing
End Sub

In Module:
Option Explicit
Dim nextSecond

Sub startFlashing()
flashCell
End Sub

Sub stopFlashing()
On Error Resume Next
Application.OnTime nextSecond, "flashCell", , False
End Sub

Sub flashCell()
nextSecond = Now + TimeValue("00:00:01")
Application.OnTime nextSecond, "flashCell"


If Range("B1").Interior.ColorIndex = 36 Then
Sheet1.Range("B1").Interior.ColorIndex = 41
Sheet1.Range("B1").Value = "Light Blue"

Sheet2.Range("B1").Interior.ColorIndex = 41
Sheet2.Range("B1").Value = "Light Blue"

Sheet3.Range("B1").Interior.ColorIndex = 41
Sheet3.Range("B1").Value = "Light Blue"

ElseIf Range("B1").Interior.ColorIndex = 41 Then
Sheet1.Range("B1").Interior.ColorIndex = 36
Sheet1.Range("B1").Value = "Light Yellow"

Sheet2.Range("B1").Interior.ColorIndex = 36
Sheet2.Range("B1").Value = "Light Yellow"

Sheet3.Range("B1").Interior.ColorIndex = 36
Sheet3.Range("B1").Value = "Light Yellow"
End If
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Code help

hi
what is it doing/not doing?????

i suspect that you haven't defined nextsecond properly.

Regards
FSt1

"MAX" wrote:

Will you please tell me what I have wrong with this code?

In Workbook:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
stopFlashing
End Sub

Private Sub Workbook_Open()
startFlashing
End Sub

In Module:
Option Explicit
Dim nextSecond

Sub startFlashing()
flashCell
End Sub

Sub stopFlashing()
On Error Resume Next
Application.OnTime nextSecond, "flashCell", , False
End Sub

Sub flashCell()
nextSecond = Now + TimeValue("00:00:01")
Application.OnTime nextSecond, "flashCell"


If Range("B1").Interior.ColorIndex = 36 Then
Sheet1.Range("B1").Interior.ColorIndex = 41
Sheet1.Range("B1").Value = "Light Blue"

Sheet2.Range("B1").Interior.ColorIndex = 41
Sheet2.Range("B1").Value = "Light Blue"

Sheet3.Range("B1").Interior.ColorIndex = 41
Sheet3.Range("B1").Value = "Light Blue"

ElseIf Range("B1").Interior.ColorIndex = 41 Then
Sheet1.Range("B1").Interior.ColorIndex = 36
Sheet1.Range("B1").Value = "Light Yellow"

Sheet2.Range("B1").Interior.ColorIndex = 36
Sheet2.Range("B1").Value = "Light Yellow"

Sheet3.Range("B1").Interior.ColorIndex = 36
Sheet3.Range("B1").Value = "Light Yellow"
End If
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 390
Default Code help

I want cell B1 Flashing in all 3 sheets with blue and yellow.

"FSt1" wrote:

hi
what is it doing/not doing?????

i suspect that you haven't defined nextsecond properly.

Regards
FSt1

"MAX" wrote:

Will you please tell me what I have wrong with this code?

In Workbook:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
stopFlashing
End Sub

Private Sub Workbook_Open()
startFlashing
End Sub

In Module:
Option Explicit
Dim nextSecond

Sub startFlashing()
flashCell
End Sub

Sub stopFlashing()
On Error Resume Next
Application.OnTime nextSecond, "flashCell", , False
End Sub

Sub flashCell()
nextSecond = Now + TimeValue("00:00:01")
Application.OnTime nextSecond, "flashCell"


If Range("B1").Interior.ColorIndex = 36 Then
Sheet1.Range("B1").Interior.ColorIndex = 41
Sheet1.Range("B1").Value = "Light Blue"

Sheet2.Range("B1").Interior.ColorIndex = 41
Sheet2.Range("B1").Value = "Light Blue"

Sheet3.Range("B1").Interior.ColorIndex = 41
Sheet3.Range("B1").Value = "Light Blue"

ElseIf Range("B1").Interior.ColorIndex = 41 Then
Sheet1.Range("B1").Interior.ColorIndex = 36
Sheet1.Range("B1").Value = "Light Yellow"

Sheet2.Range("B1").Interior.ColorIndex = 36
Sheet2.Range("B1").Value = "Light Yellow"

Sheet3.Range("B1").Interior.ColorIndex = 36
Sheet3.Range("B1").Value = "Light Yellow"
End If
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Code help

See Chip Pearson's site:

http://www.cpearson.com/excel/BlinkingText.aspx


"MAX" wrote in message
...
Will you please tell me what I have wrong with this code?

In Workbook:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
stopFlashing
End Sub

Private Sub Workbook_Open()
startFlashing
End Sub

In Module:
Option Explicit
Dim nextSecond

Sub startFlashing()
flashCell
End Sub

Sub stopFlashing()
On Error Resume Next
Application.OnTime nextSecond, "flashCell", , False
End Sub

Sub flashCell()
nextSecond = Now + TimeValue("00:00:01")
Application.OnTime nextSecond, "flashCell"


If Range("B1").Interior.ColorIndex = 36 Then
Sheet1.Range("B1").Interior.ColorIndex = 41
Sheet1.Range("B1").Value = "Light Blue"

Sheet2.Range("B1").Interior.ColorIndex = 41
Sheet2.Range("B1").Value = "Light Blue"

Sheet3.Range("B1").Interior.ColorIndex = 41
Sheet3.Range("B1").Value = "Light Blue"

ElseIf Range("B1").Interior.ColorIndex = 41 Then
Sheet1.Range("B1").Interior.ColorIndex = 36
Sheet1.Range("B1").Value = "Light Yellow"

Sheet2.Range("B1").Interior.ColorIndex = 36
Sheet2.Range("B1").Value = "Light Yellow"

Sheet3.Range("B1").Interior.ColorIndex = 36
Sheet3.Range("B1").Value = "Light Yellow"
End If
End Sub




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default Code help

You might try it this way:

http://excel.tips.net/Pages/T002134_Flashing_Cells.html

Creating a style is a snap:
Just select required cells, click Format, Styles and type "Flashing" into
the StyleName drop-down to add the new style.

--
Steve

"MAX" wrote in message
...
I want cell B1 Flashing in all 3 sheets with blue and yellow.

"FSt1" wrote:

hi
what is it doing/not doing?????

i suspect that you haven't defined nextsecond properly.

Regards
FSt1

"MAX" wrote:

Will you please tell me what I have wrong with this code?

In Workbook:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
stopFlashing
End Sub

Private Sub Workbook_Open()
startFlashing
End Sub

In Module:
Option Explicit
Dim nextSecond

Sub startFlashing()
flashCell
End Sub

Sub stopFlashing()
On Error Resume Next
Application.OnTime nextSecond, "flashCell", , False
End Sub

Sub flashCell()
nextSecond = Now + TimeValue("00:00:01")
Application.OnTime nextSecond, "flashCell"


If Range("B1").Interior.ColorIndex = 36 Then
Sheet1.Range("B1").Interior.ColorIndex = 41
Sheet1.Range("B1").Value = "Light Blue"

Sheet2.Range("B1").Interior.ColorIndex = 41
Sheet2.Range("B1").Value = "Light Blue"

Sheet3.Range("B1").Interior.ColorIndex = 41
Sheet3.Range("B1").Value = "Light Blue"

ElseIf Range("B1").Interior.ColorIndex = 41 Then
Sheet1.Range("B1").Interior.ColorIndex = 36
Sheet1.Range("B1").Value = "Light Yellow"

Sheet2.Range("B1").Interior.ColorIndex = 36
Sheet2.Range("B1").Value = "Light Yellow"

Sheet3.Range("B1").Interior.ColorIndex = 36
Sheet3.Range("B1").Value = "Light Yellow"
End If
End Sub




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Code help

ok. that is what you want. what is the code doing or not doing that is the
problem?

regards
FSt1

"MAX" wrote:

I want cell B1 Flashing in all 3 sheets with blue and yellow.

"FSt1" wrote:

hi
what is it doing/not doing?????

i suspect that you haven't defined nextsecond properly.

Regards
FSt1

"MAX" wrote:

Will you please tell me what I have wrong with this code?

In Workbook:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
stopFlashing
End Sub

Private Sub Workbook_Open()
startFlashing
End Sub

In Module:
Option Explicit
Dim nextSecond

Sub startFlashing()
flashCell
End Sub

Sub stopFlashing()
On Error Resume Next
Application.OnTime nextSecond, "flashCell", , False
End Sub

Sub flashCell()
nextSecond = Now + TimeValue("00:00:01")
Application.OnTime nextSecond, "flashCell"


If Range("B1").Interior.ColorIndex = 36 Then
Sheet1.Range("B1").Interior.ColorIndex = 41
Sheet1.Range("B1").Value = "Light Blue"

Sheet2.Range("B1").Interior.ColorIndex = 41
Sheet2.Range("B1").Value = "Light Blue"

Sheet3.Range("B1").Interior.ColorIndex = 41
Sheet3.Range("B1").Value = "Light Blue"

ElseIf Range("B1").Interior.ColorIndex = 41 Then
Sheet1.Range("B1").Interior.ColorIndex = 36
Sheet1.Range("B1").Value = "Light Yellow"

Sheet2.Range("B1").Interior.ColorIndex = 36
Sheet2.Range("B1").Value = "Light Yellow"

Sheet3.Range("B1").Interior.ColorIndex = 36
Sheet3.Range("B1").Value = "Light Yellow"
End If
End Sub


  #7   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 390
Default Code help

Yes

"FSt1" wrote:

ok. that is what you want. what is the code doing or not doing that is the
problem?

regards
FSt1

"MAX" wrote:

I want cell B1 Flashing in all 3 sheets with blue and yellow.

"FSt1" wrote:

hi
what is it doing/not doing?????

i suspect that you haven't defined nextsecond properly.

Regards
FSt1

"MAX" wrote:

Will you please tell me what I have wrong with this code?

In Workbook:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
stopFlashing
End Sub

Private Sub Workbook_Open()
startFlashing
End Sub

In Module:
Option Explicit
Dim nextSecond

Sub startFlashing()
flashCell
End Sub

Sub stopFlashing()
On Error Resume Next
Application.OnTime nextSecond, "flashCell", , False
End Sub

Sub flashCell()
nextSecond = Now + TimeValue("00:00:01")
Application.OnTime nextSecond, "flashCell"


If Range("B1").Interior.ColorIndex = 36 Then
Sheet1.Range("B1").Interior.ColorIndex = 41
Sheet1.Range("B1").Value = "Light Blue"

Sheet2.Range("B1").Interior.ColorIndex = 41
Sheet2.Range("B1").Value = "Light Blue"

Sheet3.Range("B1").Interior.ColorIndex = 41
Sheet3.Range("B1").Value = "Light Blue"

ElseIf Range("B1").Interior.ColorIndex = 41 Then
Sheet1.Range("B1").Interior.ColorIndex = 36
Sheet1.Range("B1").Value = "Light Yellow"

Sheet2.Range("B1").Interior.ColorIndex = 36
Sheet2.Range("B1").Value = "Light Yellow"

Sheet3.Range("B1").Interior.ColorIndex = 36
Sheet3.Range("B1").Value = "Light Yellow"
End If
End Sub


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
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Run VBA code only worksheet change, but don't trigger worksheet_change event based on what the code does ker_01 Excel Programming 6 October 3rd 08 09:45 PM
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. Corey Excel Programming 3 December 11th 06 06:14 AM
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... Corey Excel Programming 4 November 25th 06 05:57 AM
Excel code convert to Access code - Concat & eliminate duplicates italia Excel Programming 1 September 12th 06 12:14 AM


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