PDA

View Full Version : Control Inputbox as number only?



doctortt
03-28-2011, 08:19 AM
Hi, I'm very new to VBA. I know how to write the codes for building an inputbox, but I'm not too sure about the codes to validiate the data.

For example, if the user enters a non-digit character, I want Excel to throw out an error message and then prompt the user to enter again. Any help would be appreciated.

Thanks

p45cal
03-28-2011, 08:43 AM
x = Application.InputBox("Prompt", "Title", , , , , , 1)

the 1 being the important bit.

Kenneth Hobs
03-28-2011, 08:44 AM
How is this different than your other post? http://www.vbaexpress.com/forum/showthread.php?t=36763

doctortt
03-28-2011, 10:59 AM
Sorry all, I wasn't being detail-oriented and missed that part.