Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jas Jas is offline
external usenet poster
 
Posts: 42
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
Jas Jas is offline
external usenet poster
 
Posts: 42
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display error message if a cell is left blank Another Excel User Excel Discussion (Misc queries) 8 February 11th 08 09:02 PM
#DIV/0! Error - Need to display 0 or blank Brooks W. Excel Worksheet Functions 5 February 14th 07 03:36 PM
Validating cells left blank chris100[_42_] Excel Programming 4 December 4th 05 05:39 PM
PivotTable (blank) cells won't display NULL! Abdul Malik Said Excel Programming 3 March 24th 05 08:32 PM
How to display a blank cell with no error message Juco Excel Worksheet Functions 11 January 31st 05 08:24 AM


All times are GMT +1. The time now is 08:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"