PDA

View Full Version : Inputbox format



tqm1
07-30-2007, 05:59 PM
Dear Experts

I want inputbox to accept only digits and maximum number of digits should not increase by 5 as 12345

please help

mikerickson
07-30-2007, 06:18 PM
This will validate the data as you want.

Dim userInput As Variant
Do
userInput = Application.InputBox("Enter a number < 10^6", Type:=1)
If userInput = False Then MsgBox "cancel pressed": Exit Sub
If 5 < Len(CStr(userInput)) Then MsgBox "Entry too long"
Loop Until Len(CStr(userInput)) < 6
MsgBox userInput & " is a good input."

tqm1
07-30-2007, 09:22 PM
Is it possible to show some icon or picture with inputbox?

rory
07-31-2007, 02:56 AM
No - if you need that you should look at creating a simple userform.
Regards,
Rory