msgbox Query

shaylynch

Board Regular
Joined
Nov 11, 2002
Messages
163
hi All,
i have written a macro to update another sheet with certain values, however i am looking for code that if one particular cell is equal to "True" that a MsgBox will ask the question "Are you sure you to Close Project" and if yes that the macro will continue

thanks in advance

Shay
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

BrianB

Well-known Member
Joined
Feb 17, 2003
Messages
8,127
Something like this :-
Code:
Dim rsp As String
If Worksheets("Sheet1").Range("A1").Value = "True" Then
    rsp = MsgBox("Are you sure", vbYesNo)
    If rsp = vbNo Then
        Exit Sub
    End If
End If
'- continue
 

shaylynch

Board Regular
Joined
Nov 11, 2002
Messages
163
hi Brian,
thanks for your reply,
the code works fine, but the only issue i have now is that, this subroutine isn't always used and when that no isn't there, the macro, outside of this sub doesn't seem to work now.

Shay
 

BrianB

Well-known Member
Joined
Feb 17, 2003
Messages
8,127
You will need to change it to do what you need.
I have put Exit Sub which ends the macro.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,805
Messages
5,833,773
Members
430,232
Latest member
Testsubject

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
Top