Forum Discussion
blink a cell
- Mar 23, 2018
Hello.
If i recall correctly. I think i have answered similar question like this before.
I think you may have difficulty on how to replicate the solution in your own file.I have recorded a video on how you can do it by yourself.
This is the first part of the code that goes to a module
Option Explicit Public rRange As Range Dim dNextTime As Double Sub StartBlink() On Error GoTo ErrorHandle With rRange.Interior If .ColorIndex = 3 Then .ColorIndex = xlNone Else .ColorIndex = 3 End If End With dNextTime = Now + TimeSerial(0, 0, 1) Application.OnTime dNextTime, "StartBlink", , True Exit Sub ErrorHandle: MsgBox Err.Description & " Procedure StartBlink." Set rRange = Nothing End Sub Sub StopBlink() On Error GoTo ErrorHandle rRange.Interior.ColorIndex = xlNone Application.OnTime dNextTime, "StartBlink", , False BeforeExit: Set rRange = Nothing Exit Sub ErrorHandle: MsgBox Err.Description & " Procedure StopBlink." Resume BeforeExit End Suband this is the second part which goes to the Sheet Form object
Option Explicit Dim bCellCheck As Boolean Dim bBlink As Boolean Private Sub Worksheet_Change(ByVal Target As Excel.Range) Dim rColumn As Range Dim sAdress As String On Error GoTo ErrorHandle If Not IsEmpty(Range("B27")) Then Set rColumn = Range("B27") End If bCellCheck = False If Range("G27").Value = "" Then bCellCheck = True If Len(sAdress) > 0 Then sAdress = sAdress & "," & rColumn.Address Else sAdress = sAdress & rColumn.Address End If End If If bCellCheck = True And bBlink = False Then Set rRange = Range(sAdress) bBlink = True StartBlink ElseIf bCellCheck = True And bBlink = True Then Set rRange = rColumn StopBlink Set rRange = Range(sAdress) StartBlink ElseIf bCellCheck = False And bBlink = True Then Set rRange = rColumn StopBlink bBlink = False End If Exit Sub ErrorHandle: MsgBox Err.Description & " Procedure Worksheet_Change." Set rRange = Nothing Set rColumn = Nothing bCellCheck = False End Sub
Mr Jamil Mohammad
Thank you for being so patient with my queries
finally IT WAS DONE!!
maybe if it is not too much, the worksheet "Form" is the template
and I don't want it to be copied or duplicated within the workbook - what a mess it would be -- how could I deactivate the copy sheet function (Ctrl key +mouse dragging of sheet tag to the right) or the right click function, just for the worksheet "Form". protect workbook won't do it - as it freezes all worksheets!
Thank you again for your kind assistance
MORE POWER TO YOU