添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Hello everyone
I have a worksheet change code that flashes cell A1 if it is greater than 5 , and I put this code in standard module

Code: Select all

Sub Test()
    Application.OnTime Now + TimeValue("00:00:01"), "Sheet1.Worksheet_Change"
End Sub
And in worksheet change I put call Test at the end
But I got argument not optional error
Any help please
This is the code in sheet change

Code: Select all

Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$A$1" Then
        If Target.Value <= 5 Then
            Exit Sub
        End If
        If Format(Now, "ss") Mod 2 = 0 Then
            Range("A1").Interior.Color = vbRed
            Range("A1").Font.Color = vbWhite
            Range("A1").Font.Size = 11
            Range("A1").Font.Bold = True
            Range("A1").Interior.ColorIndex = xlNone
            Range("A1").Font.Color = vbBlack
            Range("A1").Font.Bold = False
        End If
        Call Test
    End If
End Sub
I didn't get what argument is missing ..
Do you mean that

Code: Select all

Application.OnTime Now + TimeValue("00:00:01"), "Sheet1.Worksheet_Change(ByVal Target As Range)"
I tried but got an error too
Thanks a lot. it seems that my approach for doing that task is not valid as I got from your post
Thank you very much for help