Hello,
I am looking to have my VBA code trigger a message box upon opening the file which asks the user if they'd like to clear certain cells. I want the "Yes" on the first question to trigger another message box asking them if they are sure they want to go through with it. I need the "Yes" on the second message box to clear the cells. Thank you for the help, here is my code:
Private Sub Workbook_Open()
Dim answer As Integer
Dim answer1 As Integer
answer = MsgBox("Please note that this file is a template for company use. No manual updates to this file should be saved on the public drive. Please select Yes to clear all manual pricing overrides (blue columns) to avoid formula errors. If you have saved a copy of this file to your own records, please disregard this message and select No to keep the information you have entered.", vbYesNo + vbQuestion, "Please Read")
If answer = vbYes Then
answer1 = MsgBox("Are you sure you want to clear the contents of the manual override columns?", vbYesNo + vbQuestion, "Please Read")
If answer1 = vbYes Then
Range("AC7:AC5000").Select
Selection.ClearContents
End If
Else
End If
End Sub
Bookmarks