Use the Excel input box rather than the VBA inputbox
Dim vInput as Long
vInput = Appliction.Inputbox("Please Write Your Item, "Add New Item", _
Type:=1)
this will only accept numbers.
but, isnumeric doesn't return true for strings that are not just numbers
? isnumeric("B80")
False
--
Regards,
Tom Ogilvy
"helmekki " wrote in message
...
Hi
my problem is when placing a number begining wiht a letter (p80) this
code does recognise it as a number so the macro take it as it is, but
this couses a problem to me becasue i do want the macro to discard the
number if it contains some numbers and some letters.
however, the code works fins when i put only a number (Ex: 800)
sub test()
Dim vInput As String
Dim myRow As Range
vInput = InputBox("Please Write Your Item", "Add New Item")
If IsNumeric(vInput) Then
MsgBox ("Please Enter An Item")
vInput = InputBox("Please Write Your Item", "Add New Item")
End If
End sub
yours hesham
---
Message posted from http://www.ExcelForum.com/