ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to know if Cell is Text or Number (https://www.excelbanter.com/excel-programming/331127-macro-know-if-cell-text-number.html)

Donkin[_7_]

Macro to know if Cell is Text or Number
 

I have a macro which I want to give an error message if text is entere
instead of a number.

I would like something like

If range("a1").value = istext then _

If range("a1").value = isnumber then _

I want to tell the user that they have not inputted a valid number.

Any help appreciate

--
Donki
-----------------------------------------------------------------------
Donkin's Profile: http://www.excelforum.com/member.php...fo&userid=2371
View this thread: http://www.excelforum.com/showthread.php?threadid=37703


mangesh_yadav[_271_]

Macro to know if Cell is Text or Number
 

You got a reply in another thread:
http://excelforum.com/showthread.php?t=377020


You could use:
If IsNumeric(Range("A1")) then

will return true for numbers and false for text


Manges

--
mangesh_yada
-----------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...fo&userid=1047
View this thread: http://www.excelforum.com/showthread.php?threadid=37703



All times are GMT +1. The time now is 12:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com