Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Display error msg when cells left blank
I am creating a form that users have to input (straight on to the worksheet)
certain information into. There are certain bits of information that is mandatory and if these are not filled in then I want an error message to appear saying that they have to fill that box in before they proceed. Can anyone help on how I can do this? Thanks! Jas |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Display error msg when cells left blank
Jas wrote:
I am creating a form that users have to input (straight on to the worksheet) certain information into. There are certain bits of information that is mandatory and if these are not filled in then I want an error message to appear saying that they have to fill that box in before they proceed. Can anyone help on how I can do this? Thanks! Jas Hello When the commandbutton is clicked that tranfers your data to your sheet you need to test the textbox items that you want to be filled e.g. commandbutton1_click() If textbox1.value = "" then msgbox "You need to fill in your name" exit sub end if If the textbox contains data then it will be ignored, you may need to repeat this process if you have more than one box -- Message posted via http://www.officekb.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Display error msg when cells left blank
Sorry ive misinterpreted your post, please ignore my answer
-- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200603/1 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Display error msg when cells left blank
You will probably need to put code in an appropriate event. Chip Pearson has
an overview of the events at http://www.cpearson.com/excel/events.htm look them over and decide when you want to determine if the user has complied. -- Regards, Tom Ogilvy "Jas" wrote: I am creating a form that users have to input (straight on to the worksheet) certain information into. There are certain bits of information that is mandatory and if these are not filled in then I want an error message to appear saying that they have to fill that box in before they proceed. Can anyone help on how I can do this? Thanks! Jas |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Display error msg when cells left blank
It would be a worksheet change event but the code doesnt seem to work:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) If Range(C3).Value = "" Then Application.EnableEvents = False MsgBox "This is a mandatory field. Please enter you name." End If Application.EnableEvents = True End sub "Tom Ogilvy" wrote: You will probably need to put code in an appropriate event. Chip Pearson has an overview of the events at http://www.cpearson.com/excel/events.htm look them over and decide when you want to determine if the user has complied. -- Regards, Tom Ogilvy "Jas" wrote: I am creating a form that users have to input (straight on to the worksheet) certain information into. There are certain bits of information that is mandatory and if these are not filled in then I want an error message to appear saying that they have to fill that box in before they proceed. Can anyone help on how I can do this? Thanks! Jas |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Display error msg when cells left blank
Hello
try using a validation on the cell data-validation... "Jas" wrote: It would be a worksheet change event but the code doesnt seem to work: Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) If Range(C3).Value = "" Then Application.EnableEvents = False MsgBox "This is a mandatory field. Please enter you name." End If Application.EnableEvents = True End sub "Tom Ogilvy" wrote: You will probably need to put code in an appropriate event. Chip Pearson has an overview of the events at http://www.cpearson.com/excel/events.htm look them over and decide when you want to determine if the user has complied. -- Regards, Tom Ogilvy "Jas" wrote: I am creating a form that users have to input (straight on to the worksheet) certain information into. There are certain bits of information that is mandatory and if these are not filled in then I want an error message to appear saying that they have to fill that box in before they proceed. Can anyone help on how I can do this? Thanks! Jas |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Display error message if a cell is left blank | Excel Discussion (Misc queries) | |||
#DIV/0! Error - Need to display 0 or blank | Excel Worksheet Functions | |||
Validating cells left blank | Excel Programming | |||
PivotTable (blank) cells won't display NULL! | Excel Programming | |||
How to display a blank cell with no error message | Excel Worksheet Functions |