![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Posts: 42
|
Ok second question of the day.
Can someone tell me the code I need to validate form entry. I want a message box to appear if someone attempts to submit details(by clicking a button) if they have left a textbox empty (or put the wrong info in). Thanks Andy |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
|
There's many ways to do this. As a starter you might try stuff like: -
If TextBox1.Text = "" Then MsgBox .... If Not IsNumeric(TextBox1.Text) Then MsgBox ... MaxValue = 1000 ' As an example If TextBox1.Text > MaxValue Then MsgBox ... Note you can also restrict what people can actually type into a textbox in the first place with the TextBox_Change() Event. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|