我在我们的文件中使用下面的命令,但它不起作用。 当第一个参数小于第二个参数时,它不起作用!
Private Sub auto_close()
' This macro hides sheets when the user closes the workbook
' It is a "Private Sub" to prevent it being listed with outher macros
On Error Resume Next
' When workbook is closed hide sheets required
If Sheets("PRICE").Rang("P5") > Sheets("SadraTajhiz").Range("P5") Then
If Sheets("SadraTajhiz").Range("P5") = "0" Then'
Worksheets("PAYMENT").Visible = xlSheetVeryHidden
Application.Goto Sheets("PRICE").Range("A2")
Else
Worksheets("PAYMENT").Visible = xlSheetVeryHidden
Application.Goto Sheets("SadraTajhiz").Range("A2")
End If
Else
Application.Goto Sheets("PRICE").Range("A2")
Worksheets("PAYMENT").Visible = xlSheetVeryHidden
End If
End Sub