Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What's the best way to validate that something is not a number (or is a
number, for that matter) in excel VBA? I need to handle an input box with this validation. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
forgot to mention - I used to do Javascript, and if you know Javascript, its
easy to do because there is the NaN function. But how to do it in excel VBA? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can use the IsNumeric function to return True or False
indicating whether a character string is numeric. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "MrPixie" wrote in message ... What's the best way to validate that something is not a number (or is a number, for that matter) in excel VBA? I need to handle an input box with this validation. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
MrPixie
Example numbrows = InputBox("How many rows to insert") If numbrows = "" Or Not IsNumeric(numbrows) Then 'do something Gord Dibben Excel MVP On Tue, 18 May 2004 18:14:20 +0100, "MrPixie" wrote: What's the best way to validate that something is not a number (or is a number, for that matter) in excel VBA? I need to handle an input box with this validation. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One more option is to use the application.inputbox.
Option Explicit Sub test() Dim myNumber As Variant myNumber = Application.InputBox(prompt:="Number me!", Type:=1) If myNumber = False Then Exit Sub 'cancel End If 'keep going End Sub MrPixie wrote: What's the best way to validate that something is not a number (or is a number, for that matter) in excel VBA? I need to handle an input box with this validation. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Validation Data using Validation Table cell range..... | Excel Discussion (Misc queries) | |||
data validation invalid in dynamic validation list | Excel Discussion (Misc queries) | |||
Validation (Drop down list vs simple text length validation) | Excel Programming | |||
Validation (Drop down list vs simple text length validation) | Excel Programming | |||
Validation (Drop down list vs simple text length validation) | Excel Programming |