Results 1 to 2 of 2

Thread: Data entry

  1. #1
    Join Date
    Feb 2004
    Posts
    1

    Angry Unanswered: 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

  2. #2
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •