在VBA excel中我的严格不等式公式不起作用

时间:2017-02-24 10:51:00

标签: excel-vba vba excel

我在我们的文件中使用下面的命令,但它不起作用。 当第一个参数小于第二个参数时,它不起作用!

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

0 个答案:

没有答案