If statement and Message Box

mustanggirl531

New Member
Joined
Aug 18, 2011
Messages
3
Hi,

I am trying to write a macro so that if the value of one cell is > the value of another cell then a message box appears. I've tried to write it myself but it doesn't seem to work. I've named my two cells HoldUpVol and RinseVol.

Sub RinseMessageBox()
If HoldUpVol > RinseVol Then

MessageBox.Show(Prompt:="The hold up volume on the system selected is more than your rinse volume. Please choose another system.", Buttons:=vbOKOnly)
End If

End Sub

Any help would be greatly appreciated.

Thanks,
Jillian
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Does this line of code do what you want?

Code:
MsgBox Prompt:="The hold up volume on the system selected is more than your rinse volume. Please choose another system.", Buttons:=vbOKOnly
 
Upvote 0
Hi,

Check this :

Answer = MsgBox("The hold up volume on the system selected is more than your rinse volume. Please choose another system.", vbOKCancel)..

If you got any error let me know:cool:
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,480
Members
452,915
Latest member
hannnahheileen

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