I have this marco that i need some help with.

baldi

Board Regular
Joined
Sep 15, 2009
Messages
159
how do I get this marco to stop if there is no value in cell E3. Then let the user know that they must first enter a value in cell E3 before the marco will continue.

Code:
[FONT=Calibri][SIZE=3][COLOR=#000000]answer = MsgBox(prompt:="Does CASH IN or CHIPS equalCHIPS OUT", Buttons:=vbYesNo + vbCritical, Title:="Update DaysValues")[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]    If answer = vbYesThen[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]   Sheets("Sheet2").Select[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]   ActiveSheet.Unprotect "alexandeR"[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]   Sheets("Sheet3").Select[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]   ActiveSheet.Unprotect "alexander"[/COLOR][/SIZE][/FONT]

thank you in advance.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
To build on Roderick_E's answer if you want to display a message to the user

Code:
    If Trim(Range("E3")) = "" Then
        Range("E3").Select
        MsgBox "Cell E3 is empty!" & vbCr & vbCr & "Please enter a value in cell E3", Buttons:=vbOKOnly + vbExclamation, Title:="Cell E3 needs a value"
        Exit Sub
    End If
 
Upvote 0
how do I and a formula to it. like if the sum of cells B15 and E15 do not EQUAL cell H15 the marco stops.
 
Upvote 0

Forum statistics

Threads
1,216,092
Messages
6,128,782
Members
449,468
Latest member
AGreen17

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