Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Blinking TEXT - Help needed

Hello

I found the following blinking text code via this forum.


------------------------------------------------
' First, you need to set up a procedure to cause the text to
alternate
between white and black.
' Put the following code in a regular code module:
Private RunWhen As Double


Sub StartBlink()
If Range("Blink").Font.ColorIndex = 2 Then
Range("Blink").Font.ColorIndex = xlColorIndexAutomatic
Else
Range("Blink").Font.ColorIndex = 2
End If
RunWhen = Now + TimeSerial(0, 0, 1)
Application.OnTime RunWhen, "StartBlink", , True
End Sub


Sub StopBlink()
Range("Blink").Font.ColorIndex = xlColorIndexAutomatic
Application.OnTime RunWhen, "StartBlink", , False
End Sub


' In both these procedures, change the reference to A1 to the cell
that should blink.


' When the workbook is closed, you need to cancel OnTime event
triggers,
' so put the following code in the ThisWorkbook code module.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
StopBlink
End Sub


' You need to initiate this procedure when the workbook opens, so put
the following code
' in the ThisWorkbook code module:
Private Sub Workbook_Open()
StartBlink
End Sub
---------------------------------------------------------


Its working fine as long as no other excel file is not open. As soon
as I open anything else following error open.


"Run-time erroe '1004': Method 'Range' of object'_Global failed."


Could anyone please help as I want to use this code while other files
are open.

Upon receving comments from the group I adjusted the code to reflect
the specific workbook.

Thanks for the reply.

I tried putting that code in as follows.
----------------------------------------------------------------------
Sub StartBlink()
If
Workbooks("DailyBalance").Sheets("Main").Range("Bl ink").Font.ColorIndex
= 2 Then


Workbooks("DailyBalance").Sheets("Main").Range("Bl ink").Font.ColorIndex
= xlColorIndexAutomatic
Else


Workbooks("DailyBalance").Sheets("Main").Range("Bl ink").Font.ColorIndex
= 2
End If
RunWhen = Now + TimeSerial(0, 0, 1)
Application.OnTime RunWhen, "StartBlink", , True
End Sub
---------------------------------------------------------------------


But when I re-open the file following error comes up.


"Subscript Out of range"


Any HELP?


Thanks, Naeem

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Blinking TEXT - Help needed

try putting the .xls on the end of the file name

Workbooks("DailyBalance.xls").Sheets("Main").Range ("Blink").

--
Regards,
Tom Ogilvy

" wrote:

Hello

I found the following blinking text code via this forum.


------------------------------------------------
' First, you need to set up a procedure to cause the text to
alternate
between white and black.
' Put the following code in a regular code module:
Private RunWhen As Double


Sub StartBlink()
If Range("Blink").Font.ColorIndex = 2 Then
Range("Blink").Font.ColorIndex = xlColorIndexAutomatic
Else
Range("Blink").Font.ColorIndex = 2
End If
RunWhen = Now + TimeSerial(0, 0, 1)
Application.OnTime RunWhen, "StartBlink", , True
End Sub


Sub StopBlink()
Range("Blink").Font.ColorIndex = xlColorIndexAutomatic
Application.OnTime RunWhen, "StartBlink", , False
End Sub


' In both these procedures, change the reference to A1 to the cell
that should blink.


' When the workbook is closed, you need to cancel OnTime event
triggers,
' so put the following code in the ThisWorkbook code module.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
StopBlink
End Sub


' You need to initiate this procedure when the workbook opens, so put
the following code
' in the ThisWorkbook code module:
Private Sub Workbook_Open()
StartBlink
End Sub
---------------------------------------------------------


Its working fine as long as no other excel file is not open. As soon
as I open anything else following error open.


"Run-time erroe '1004': Method 'Range' of object'_Global failed."


Could anyone please help as I want to use this code while other files
are open.

Upon receving comments from the group I adjusted the code to reflect
the specific workbook.

Thanks for the reply.

I tried putting that code in as follows.
----------------------------------------------------------------------
Sub StartBlink()
If
Workbooks("DailyBalance").Sheets("Main").Range("Bl ink").Font.ColorIndex
= 2 Then


Workbooks("DailyBalance").Sheets("Main").Range("Bl ink").Font.ColorIndex
= xlColorIndexAutomatic
Else


Workbooks("DailyBalance").Sheets("Main").Range("Bl ink").Font.ColorIndex
= 2
End If
RunWhen = Now + TimeSerial(0, 0, 1)
Application.OnTime RunWhen, "StartBlink", , True
End Sub
---------------------------------------------------------------------


But when I re-open the file following error comes up.


"Subscript Out of range"


Any HELP?


Thanks, Naeem


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Blinking TEXT - Help needed

On Apr 3, 1:28 pm, Tom Ogilvy
wrote:
try putting the .xls on the end of the file name

Workbooks("DailyBalance.xls").Sheets("Main").Range ("Blink").

--
Regards,
Tom Ogilvy



" wrote:
Hello


I found the following blinking text code via this forum.


------------------------------------------------
' First, you need to set up a procedure to cause the text to
alternate
between white and black.
' Put the following code in a regular code module:
Private RunWhen As Double


Sub StartBlink()
If Range("Blink").Font.ColorIndex = 2 Then
Range("Blink").Font.ColorIndex = xlColorIndexAutomatic
Else
Range("Blink").Font.ColorIndex = 2
End If
RunWhen = Now + TimeSerial(0, 0, 1)
Application.OnTime RunWhen, "StartBlink", , True
End Sub


Sub StopBlink()
Range("Blink").Font.ColorIndex = xlColorIndexAutomatic
Application.OnTime RunWhen, "StartBlink", , False
End Sub


' In both these procedures, change the reference to A1 to the cell
that should blink.


' When the workbook is closed, you need to cancel OnTime event
triggers,
' so put the following code in the ThisWorkbook code module.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
StopBlink
End Sub


' You need to initiate this procedure when the workbook opens, so put
the following code
' in the ThisWorkbook code module:
Private Sub Workbook_Open()
StartBlink
End Sub
---------------------------------------------------------


Its working fine as long as no other excel file is not open. As soon
as I open anything else following error open.


"Run-time erroe '1004': Method 'Range' of object'_Global failed."


Could anyone please help as I want to use this code while other files
are open.


Upon receving comments from the group I adjusted the code to reflect
the specific workbook.


Thanks for the reply.


I tried putting that code in as follows.
----------------------------------------------------------------------
Sub StartBlink()
If
Workbooks("DailyBalance").Sheets("Main").Range("Bl ink").Font.ColorIndex
= 2 Then


Workbooks("DailyBalance").Sheets("Main").Range("Bl ink").Font.ColorIndex
= xlColorIndexAutomatic
Else


Workbooks("DailyBalance").Sheets("Main").Range("Bl ink").Font.ColorIndex
= 2
End If
RunWhen = Now + TimeSerial(0, 0, 1)
Application.OnTime RunWhen, "StartBlink", , True
End Sub
---------------------------------------------------------------------


But when I re-open the file following error comes up.


"Subscript Out of range"


Any HELP?


Thanks, Naeem- Hide quoted text -


- Show quoted text -


Hurray - it worked.....Thanks a lot

Naeem

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
Blinking text somaloft Excel Worksheet Functions 1 May 3rd 08 03:01 PM
Help Needed - Blinking TEXT [email protected] Excel Programming 2 April 3rd 07 02:29 PM
Help with blinking text EW Excel Programming 2 June 26th 06 05:11 AM
Blinking Text KK[_5_] Excel Programming 2 November 16th 05 10:57 AM
blinking text lucas Excel Programming 5 October 31st 05 04:12 PM


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