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 > Presence check

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-06-04, 11:17
craig_dixon craig_dixon is offline
Registered User
 
Join Date: Jan 2004
Posts: 106
Presence check

how do i make it so that if a value (any value) isnt entered into a cell, an error message is displayed?
Reply With Quote
  #2 (permalink)  
Old 04-06-04, 11:29
shades shades is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 04-06-04, 11:30
craig_dixon craig_dixon is offline
Registered User
 
Join Date: Jan 2004
Posts: 106
what does counta do?
Reply With Quote
  #4 (permalink)  
Old 04-06-04, 11:44
shades shades is offline
Registered User
 
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.
__________________
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

Last edited by shades; 04-06-04 at 11:48.
Reply With Quote
  #5 (permalink)  
Old 04-07-04, 08:17
craig_dixon craig_dixon is offline
Registered User
 
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?
Reply With Quote
  #6 (permalink)  
Old 04-07-04, 19:40
harg7769 harg7769 is offline
Registered User
 
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
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