message box yes no macro

VbaHell

Well-known Member
Joined
Jan 30, 2011
Messages
1,220
Hello all
A member of the Excel forum kindly helped with this code and I want to expand it to saying.

Number of supplier email missing
Proceed Yes or No
if yes then action my code
if no then end function

Code:
With Sheets("Data")
        LastRow = .Range("B" & Rows.Count).End(xlUp).Row
        Set rng = .Range("AA2:AA" & LastRow).SpecialCells(xlCellTypeBlanks)
    End With
    MsgBox "Number of Supplier Emails missing: " & rng.Count
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
How about
Code:
With Sheets("Data")
        lastrow = .Range("B" & Rows.count).End(xlUp).Row
        Set Rng = .Range("AA2:AA" & lastrow).SpecialCells(xlCellTypeBlanks)
    End With
    If MsgBox("Number of Supplier Emails missing: " & Rng.count, vbYesNo) = vbNo Then Exit Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,171
Members
453,021
Latest member
Justyna P

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