Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 394
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Return Numeric Label based on (Numeric Value) Criterion Sam via OfficeKB.com Excel Worksheet Functions 2 September 18th 06 11:20 PM
Find Numeric Criterion in Column & Return the Numeric Value from Row above Sam via OfficeKB.com Excel Worksheet Functions 6 April 27th 06 02:50 PM
Numeric in Text to convert back to the form of Numeric for VLookup Purposes achilles Excel Discussion (Misc queries) 4 February 6th 06 07:05 AM
Match Single Numeric Criteria and Return Multiple Numeric Labels Sam via OfficeKB.com Excel Worksheet Functions 3 December 30th 05 08:01 PM
Match Single Numeric Criteria and Return Multiple Numeric Labels Sam via OfficeKB.com Excel Worksheet Functions 0 December 29th 05 08:44 PM


All times are GMT +1. The time now is 03:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"