Results 1 to 6 of 6

Thread: Presence check

  1. #1
    Join Date
    Jan 2004
    Posts
    106

    Unanswered: Presence check

    how do i make it so that if a value (any value) isnt entered into a cell, an error message is displayed?

  2. #2
    Join Date
    Oct 2003
    Posts
    1,091
    Suppose cells B2:B10 is where you want to begin this. Then choose Data > Validation, and in dialog box select Custom. In the formula area put:


    =COUNTA($B$2:$B2)=ROWS($1:1)

    and copy down from B2 to B10.

    Adjust references as needed.
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  3. #3
    Join Date
    Jan 2004
    Posts
    106
    what does counta do?

  4. #4
    Join Date
    Oct 2003
    Posts
    1,091
    It checks to make sure that each cell is filled in (by counting the number of cells in the expanding range) - notice the mixed absolute and relative references. As you copy it down, it will change appropriately so that all cells will require filling.

    If this method does not work, post back.
    Last edited by shades; 04-06-04 at 12:48.
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  5. #5
    Join Date
    Jan 2004
    Posts
    106
    i only need to check that one field has a value in it, not a row or column of cells. also, where do i put the formula?

  6. #6
    Join Date
    Mar 2004
    Location
    Glasgow
    Posts
    8

    IS this what you mean?

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If IsEmpty(Range("A1").Value) Then
    MsgBox "Please enter data into cell A1"
    Range("A1").Select
    Exit Sub
    End If

    End Sub

    The above uses VBA to check that cell A1 isn't empty, every time you try and do something. Anything. It will then show the error message and return you to cell A1 until you putt something in it. You could probably then use Data Validation to make sure the correct value is put in.

    Andrew H

Posting Permissions

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