Re: Add a Confirmation Message Box to a macro?

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.

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:
Re: Add a Confirmation Message Box to a macro?

Hi, Trying to amend the code to include in the message box details of failed items.

So in the active column, I have some cells indicating "FAILED". in the adjacent columns I have data in Column A and B. How will the below code be amended so it lists the corresponding data in Column A and B when the message box appears??

At the moment it indicates how many failed items in the active column, but I need to add to this and provide details what the failed items are from Column A and B.
Many thanks


Sub Messagebox1()
Dim instances As Long instances = WorksheetFunction.CountIf(Columns(ActiveCell.Column), "FAILED") MsgBox "Found " & instances & " Failed Upload(s)", vbInformation, "TITLE"
End sub
 
Upvote 0

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Re: Add a Confirmation Message Box to a macro?

As this question has no relevance to this thread, please start a thread of your own.
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,580
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top