Hi All,
There is a button in my worksheet which will allow user to proceed to computation worksheet.
I would like to create a code which will check the value of a group of cells Range("B2:D2,H2,J2,N2,R2,V2,X2,Z2,AB2,AD2.AF2,AH2,AN2,AP2:AX2").
If the value in any of these cells is equal to 1, message box will ask them to change the value and not allow user to proceed.
I tried with this code but it gives me error.
Appreciate your guidance.
Thanks.
Norvin
There is a button in my worksheet which will allow user to proceed to computation worksheet.
I would like to create a code which will check the value of a group of cells Range("B2:D2,H2,J2,N2,R2,V2,X2,Z2,AB2,AD2.AF2,AH2,AN2,AP2:AX2").
If the value in any of these cells is equal to 1, message box will ask them to change the value and not allow user to proceed.
I tried with this code but it gives me error.
Code:
Sub Prem_Cal()
If Sheets("PS2010_Rel").Range("B2:D2,H2,J2,N2,R2,V2,X2,Z2,AB2,AD2.AF2,AH2,AN2,AP2:AX2") = 1 Then
Warning = MsgBox("Please make sure the value is enterred correctly", vbOKOnly + vbCritical + vbDefaultButton1, "Discount Restriction")
End
End If
Range("A1").Select
ActiveWorkbook.Unprotect "msigps10"
Sheets("Prem").Visible = True
Sheets("Prem").Activate
Range("A1").Select
Sheets("Main").Visible = False
ActiveWorkbook.Protect "msigps10"
End Sub
Appreciate your guidance.
Thanks.
Norvin