Hi Mike !!
Thanks for the help. It too works.
But, the moment i put a conditional formating or change the format of the
range for which i execute the below code, it does not work and gives an error.
All i was trying with the blink program that :
1.) the Text should be in white colour &
2.) the cell color(fill) should be blue.
Can i in-built this in the below code itself.
rgds // Sk.
- Show quoted text -
Hi sansk, Try the code below. Paste this code into your Workbook
Module (right click on Tab + go to "Insert" + click on "Module")
Public RunWhen As Double
Sub StartBlink()
Set myrange = Range("A1:H100") ' CHANGE THIS RANGE TO YOUR NEED
For Each c In myrange
If Left(c, 1) = "F" Then
If c.Interior.ColorIndex = 5 Then ' BLUE CELL COLOUR
c.Interior.ColorIndex = 2 ' WHITE CELL COLOUR
Else
c.Interior.ColorIndex = 5 ' BLUE CELL COLOUR
End If
End If
If Left(c, 1) = "F" Then
c.Font.ColorIndex = 2
c.Font.Bold = True
End If
Next
RunWhen = Now + TimeSerial(0, 0, 1)
Application.OnTime RunWhen, "StartBlink", , True
End Sub
Sub StopBlink()
Set myrange = Range("A1:H100")
For Each c In myrange
c.Interior.ColorIndex = 0
c.Font.ColorIndex = 0
c.Font.Bold = False
Next
Application.OnTime RunWhen, "StartBlink", , False
End Sub
The macro above will blink text only which will start with uppercase
text character "F" not with lowercase text character "f" so you have
to make sure that your first text character should be in uppercase.
Now if you want to see your all words which starts from letter "F"
should blink when you open your workbook then add or paste the codes
below in your "ThisWorkbook" Module
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call StopBlink
End Sub
Private Sub Workbook_Open()
Call StartBlink
End Sub
Hop this will solve problem
K