Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Using Win XP with Office 2007;
I would like to test the contents of a cell to determine if it contains a numeric constant (i.e. a number, but not a date, or formula). For example, you would use IsDate to test for a date; is there an equivalent for a numeric constant? 1) Could an example function be posted that returns true if the current cell contains a numeric constant? Also, is there a type for a formula? 2) If so, could an example function be posted that returns true if the current cell contains a formula? 3) A formula that evaluates to a number? Thanks in advance! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Function Ntest(mycell)
If IsDate(mycell.Value) Then Ntest = False ElseIf mycell.HasFormula Then Ntest = False Else Ntest = WorksheetFunction.IsNumber(mycell.Value) End If End Function Note that a value such as 12 typed into a cell formatted as text will return FALSE with this UDF best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "XP" wrote in message ... Using Win XP with Office 2007; I would like to test the contents of a cell to determine if it contains a numeric constant (i.e. a number, but not a date, or formula). For example, you would use IsDate to test for a date; is there an equivalent for a numeric constant? 1) Could an example function be posted that returns true if the current cell contains a numeric constant? Also, is there a type for a formula? 2) If so, could an example function be posted that returns true if the current cell contains a formula? 3) A formula that evaluates to a number? Thanks in advance! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This might work...
Function IsNumConst(Cell As Range) As Boolean With Cell IsNumConst = (CStr(.Value) = CStr(.Formula)) And IsNumeric(.Value2) End With End Function -- Rick (MVP - Excel) "XP" wrote in message ... Using Win XP with Office 2007; I would like to test the contents of a cell to determine if it contains a numeric constant (i.e. a number, but not a date, or formula). For example, you would use IsDate to test for a date; is there an equivalent for a numeric constant? 1) Could an example function be posted that returns true if the current cell contains a numeric constant? Also, is there a type for a formula? 2) If so, could an example function be posted that returns true if the current cell contains a formula? 3) A formula that evaluates to a number? Thanks in advance! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
TO DELETE ONLY NUMERIC VALUES IN A CHARACTER AND NUMERIC CELL IN | Excel Discussion (Misc queries) | |||
How do I copy numeric section of cell from alpha-numeric cell | Excel Worksheet Functions | |||
Need to test for alphanumeric value and write numeric values to ce | Excel Worksheet Functions | |||
Test IF Two Numeric Values Match (from two separate Dynamic Ranges) | Excel Worksheet Functions | |||
how can i test whether cell contains keyed constant or a formulae | Excel Worksheet Functions |