If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Data entry

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-13-04, 04:56
ejner ejner is offline
Registered User
 
Join Date: Feb 2004
Posts: 1
Angry Data entry

In a data entry form build in Excel I would like to block the
posibility to leave some cells blank.

In the datavalidity function the Ignore blank cells does not
have any effect, so what can be used to ensure a value is
entered?


best regards
Ejner
Reply With Quote
  #2 (permalink)  
Old 02-13-04, 12:49
Smitty Smitty is offline
Registered User
 
Join Date: Dec 2003
Location: San Diego, CA
Posts: 153
Welcome to the Board!

If you're using a User Form, it's relatively easy to validate blanks with IF statements. I.E.
Code:
Private Sub TextBox1_Exit
  If TextBox1.Value = "" Then
    MsgBox "You must enter a Value"
  End If
Exit Sub
If you're talking about validating a worksheet it's a bit of a different thing. Ignore blanks will only work if a cell has been activated, so 2 options would be to create a VBA routine in either a Private Sub Worksheet_Deactivate event, which goes in the specific sheet module, or a Private Sub Workbook_BeforeClose(Cancel As Boolean) event, which goes in the ThisWorkbook module, to evaluate specific cells for entries. I.E.
Code:
If Sheets("Sheet1").Range("A1").Value = "" Then
  MsgBox "You must enter a value"
  Range("A1").Select
Hope that helps,

Smitty
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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