Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Must Contain a Numeric Value
Hi everyone,
For Sub One :- I would like a message box to appear if the Range "B4" does NOT hold a numeric value greater than 0 and Less Than or Equal to 13983816 please. For Sub Two :- I would like a message box to appear if the Range "B6:G6" does NOT hold numeric values greater than 0 and Less Than or Equal to 49 please. In both cases, text, blanks, zeros and nulls etc would also throw out the message boxes, the values MUST be numeric. Thanks in Advance. All the Best. Paul |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Must Contain a Numeric Value
One way:
Public Sub One() Dim bGoodValue As Boolean With Range("B4") If IsNumeric(.Value) Then _ bGoodValue = (.Value 0) And (.Value < 13983816) If Not bGoodValue Then MsgBox vbNullString End With End Sub Public Sub Two() With Range("B6:G6") If Not Application.CountIf(.Cells, "0") - _ Application.CountIf(.Cells, "=49") = .Count Then _ MsgBox vbNullString End With End Sub In article .com, Paul Black wrote: Hi everyone, For Sub One :- I would like a message box to appear if the Range "B4" does NOT hold a numeric value greater than 0 and Less Than or Equal to 13983816 please. For Sub Two :- I would like a message box to appear if the Range "B6:G6" does NOT hold numeric values greater than 0 and Less Than or Equal to 49 please. In both cases, text, blanks, zeros and nulls etc would also throw out the message boxes, the values MUST be numeric. Thanks in Advance. All the Best. Paul |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find and Return Numeric Label based on (Numeric Value) Criterion | Excel Worksheet Functions | |||
Find Numeric Criterion in Column & Return the Numeric Value from Row above | Excel Worksheet Functions | |||
Numeric in Text to convert back to the form of Numeric for VLookup Purposes | Excel Discussion (Misc queries) | |||
Match Single Numeric Criteria and Return Multiple Numeric Labels | Excel Worksheet Functions | |||
Match Single Numeric Criteria and Return Multiple Numeric Labels | Excel Worksheet Functions |