如果单元格 N63 = 0 的值,我想调用我的子单元,它会导致单元格在红色和白色之间闪烁。换句话说,如果单元格D70 = 0
则 StartBlinking 否则 StopBlinking。
这是Bliking子
Option Explicit
Public NextBlink As Double
'The cell that you want to blink
Public Const BlinkCell As String = "Sheet1!D70"
'Start blinking
Public Sub StartBlinking()
Application.Goto Range("A1"), 1
'If the color is red, change the color and text to white
If Range(BlinkCell).Interior.ColorIndex = 3 Then
Range(BlinkCell).Interior.ColorIndex = 0
Range(BlinkCell).Value = "White"
'If the color is white, change the color and text to red
Else
Range(BlinkCell).Interior.ColorIndex = 3
Range(BlinkCell).Value = "Red"
End If
'Wait one second before changing the color again
NextBlink = Now + TimeSerial(0, 0, 1)
Application.OnTime NextBlink, "StartBlinking", , True
End Sub
'Stop blkinking
Public Sub StopBlinking()
'Set color to white
Range(BlinkCell).Interior.ColorIndex = 0
'Clear the value in the cell
'Range(BlinkCell).ClearContents
On Error Resume Next
Application.OnTime NextBlink, "StartBlinking", , False
Err.Clear
End Sub
这是我if
的不起作用:
If Worksheets("Sheet1").Range("N63").Value = 0 Then
Call StartBlink()
Else
Call StopBlink()
End If
我如何称呼这两个潜艇?