Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Validation
I need to validate what the user inputs in a specific cell. I have se
validation on that cell for Whole numbers to avoid having the user typ letters and it works fine but when I run the macro that promts the use for the number, validation does not work. How can I have the macro validate that the input is a whole number with 5 characters and there's no letters? thanks one more tim -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Validation
Hi Halem2;
Use this: Sub try() Dim Message, Title, Default, MyValue Message = "Enter a number that has 5 characters" ' Set prompt. Title = "InputBox Demo" ' Set title. Default = "12345" ' Set default. ' Display message, title, and default value. MyValue = InputBox(Message, Title, Default) If Not IsNumeric(MyValue) Or Not Len(MyValue) = 5 Then MsgBox "you can't do that" End If End Sub Thanks Greg -----Original Message----- I need to validate what the user inputs in a specific cell. I have set validation on that cell for Whole numbers to avoid having the user type letters and it works fine but when I run the macro that promts the user for the number, validation does not work. How can I have the macro validate that the input is a whole number, with 5 characters and there's no letters? thanks one more time --- Message posted from http://www.ExcelForum.com/ . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Validation
Validated = (ActiveCell.Value like "#####")
-----Original Message----- I need to validate what the user inputs in a specific cell. I have set validation on that cell for Whole numbers to avoid having the user type letters and it works fine but when I run the macro that promts the user for the number, validation does not work. How can I have the macro validate that the input is a whole number, with 5 characters and there's no letters? thanks one more time --- Message posted from http://www.ExcelForum.com/ . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Validation Data using Validation Table cell range..... | Excel Discussion (Misc queries) | |||
data validation invalid in dynamic validation list | Excel Worksheet Functions | |||
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 |