message box if no cells in range > 0

ThomasOES

Board Regular
Joined
Aug 29, 2017
Messages
174
Hello
I need vba code to check a range of cells for value greater than zero.
Ive set the range = colval
If there is no value in the range greater than zero I want a message box "No Value > 0"

Thanks for any help
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Maybe:
Code:
If Application.Countif(colval,">0")>0 then MsgBox "No value > 0"
 
Upvote 0
Did you write this correctly? Shouldn't the second greater than symbol be an equal sign instead?
Yikes!!! You are correct. The OP said: "If there is no value in the range greater than zero I want a message box "No Value > 0""
Guess I missed the bold no and focused on the message :eeek:. Thanks for the catch.
 
Upvote 0
Yikes!!! You are correct. The OP said: "If there is no value in the range greater than zero I want a message box "No Value > 0""
Guess I missed the bold no and focused on the message :eeek:. Thanks for the catch.

Thanks guys. Code works perfect now.
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,149
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