raymangoose
New Member
- Joined
- Feb 22, 2015
- Messages
- 7
Re: Add a Confirmation Message Box to a macro?
I have this code that prints everything from data validation, but I also want to run a massage that says "are you sure you want to continue" before running the code. My code works separately but not with the massage code.
I have this code that prints everything from data validation, but I also want to run a massage that says "are you sure you want to continue" before running the code. My code works separately but not with the massage code.
Code:
Sub ClearINV()
Answer = MsgBox("Are you sure you want to continue?", vbYesNoCancel + vbInformation, "Application Message")
If Answer = vbYes Then Else Exit Sub
If Answer = vbYes Then Else Exit Sub
Sub Iterate_Through_data_Validation()
Dim xRg As Range
Dim xCell As Range
Dim xRgVList As Range
Set xRg = Worksheets("Lease Abstract").Range("I2")
Set xRgVList = Evaluate(xRg.Validation.Formula1)
For Each xCell In xRgVList
xRg = xCell.Value
ActiveSheet.PrintOut
Next
End Sub
End If
End Sub
Last edited by a moderator: