Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() If Textbox1.Text = "" Then Msgbox "TextBox1 empty" Textbox1.SelLength = Len(TextBox1.Text) TextBox1.SelStart = 0 TextBox1.setFocus Exit Sub ElseIf Textbox2.Text = "" Then Msgbox "TextBox2 empty" Textbox2.SelLength = Len(TextBox2.Text) TextBox2.SelStart = 0 TextBox2.setFocus Exit Sub If Textbox3.Text = "" Then Msgbox "TextBox3 empty" Textbox3.SelLength = Len(TextBox3.Text) TextBox3.SelStart = 0 TextBox3.setFocus Exit Sub If Textbox4.Text = "" Then Msgbox "TextBox1 empty" Textbox4.SelLength = Len(TextBox4.Text) TextBox4.SelStart = 0 TextBox4.setFocus Exit Sub End If -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Hayley" wrote in message ... I have 2 worksheets. One is a entry page ('form') and the second a storage for data ('database'). I have written a basic macro which enters the data from the form to the database. Howerver I would like to add to the macro and get it to check 4 cells which are mandatory. I would like it to exit out of the macro to the appropriate blank cell and display a message box to enter data. If the 4 cells have data then I would like it to continue the macro and enter data to the database sheet. Could someone please point me to a webpage with an example or explain what code I need. I have been able to get the message box to come up for the first cell but not sure how to then jump to the next mandatory one. Thanks -- Hayley |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Display error message if a cell is left blank | Excel Discussion (Misc queries) | |||
mandatory cell | Excel Discussion (Misc queries) | |||
How do I display a message when a cell has a certain value?? | Excel Discussion (Misc queries) | |||
when certain number is typed in a cell to display a message | Excel Discussion (Misc queries) | |||
How to display a blank cell with no error message | Excel Worksheet Functions |