Hello,
I try to make macro . shouldn't work macro Sub v() if there is no sheet name RUN at all in file and if the sheet name is existed but is hidden then should not work the code
otherwise should be work
it gives mismatch in this line
If Sheets(ws).Visible = xlVeryHidden Then
Sub run_macro()
Dim ws As Worksheet
Set ws = Sheets("RUN")
If Sheets(ws).Visible = xlVeryHidden Then
If Evaluate("ISREF('" & "Run" & "'!A1)") = True Then
Call v '! Or Macro Name
Else
MsgBox " sorry you can't running this macro, should check admin,please.", vbCritical
End If
End If
End Sub
Sub v()
Range("a2").Value = "hello"
End Sub
any idea to achieve it, please?