Firstly, thanks for reading.
If I click the button this macro is assigned to, it loops until a value is entered. I would like to be able to press cancel or escape. Any pointers?
Thanks.
If I click the button this macro is assigned to, it loops until a value is entered. I would like to be able to press cancel or escape. Any pointers?
Thanks.
Code:
Sub MyMacro()
Dim RCP_Audit_Result6 As String
Dim Updated_Value6 As String
Dim worksheet_current_three As String
Dim yes As String
Dim no As String
Dim temp_count_three
ActiveSheet.Unprotect
temp_count_three = True
yes = "YES"
no = "NO"
worksheet_current_three = "4 RCP Results"
RCP_Audit_Result6 = Sheets(worksheet_current_three).Range("I16")
Updated_Value6 = UCase(InputBox("Please update value", , RCP_Audit_Result6))
'Sheets(worksheet_current_three).Range("G10") = Updated_Value
Do While temp_count_three = True
If Updated_Value6 = yes Or Updated_Value6 = no Then
temp_count_three = False
Sheets(worksheet_current_three).Range("I16") = Updated_Value6
'Exit Do
Else
Updated_Value6 = UCase(InputBox("Updated value must be YES or NO", , RCP_Audit_Result6))
End If
Loop
ActiveSheet.Protect DrawingObjects:=True, contents:=True, Scenarios:=True
End Sub