请帮助解决下面的代码错误424
Public counter As String
Private Sub Workbook_WindowActivate(ByVal Wn As Window)
If ActiveSheet1.Name = Sheet2.Name Then
If counter = 0 Or counter = Null Then
Call LLP_Hide
End If
End If
End Sub
答案 0 :(得分:0)
从ActiveSheet1
删除1。
如果要计算counter
,则应将其声明为Integer
类型,而不是String
。
无论如何,这部分代码也会导致错误:counter = 0
。将其替换为counter = "0"
或更改counter
的类型。
Public counter As Integer
Private Sub Workbook_WindowActivate(ByVal Wn As Window)
If ActiveSheet.Name = Sheet2.Name Then
If counter = 0 Then
Call LLP_Hide
End If
End If
End Sub