How do I set specific cells for mandatory entry?

  • Thread starter Thread starter vanarsdalet
  • Start date Start date
V

vanarsdalet

I want to set a group of cells which cannot be left blank in a worksheet. is
this possible?
 
Possibly. What are your preventing? (what process would occur that you don't
want to happen if there are blanks)

One simple way is:
=COUNTBLANK(A2,B2,C3:C6)=0

Where you refer to all the cells you don't want blank. Formula returns a
boolean, which can be used in various ways to stop/halt/notify people.

You might also look into using the formula in Data-Validation.
 
I'm not sure this is what you have in mind but it is worse to checkout:
* Suppose you have some header in cell A1.
* Select the range A3:A50 > click Data > Data Validation > choose "Custom" >
in the "Formula" box type:
=COUNTA($A$2:$A2)=ROW()-2
* Watch the Absolute/Relative Addresses *
Micky
 
OR:
* Select the Range A2:A50.
* Data > Data Validation > choose "Custom" > in the "Formula" box type:
=NOT(ISBLANK(A1))
* UnCheck the "IGNORE BLANK" Checkbox.
Micky
 
OR - you may try the Event-Macro:
--------------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
Set intsect = Application.Intersect(Target, Range("A2:A" &
ActiveSheet.Rows.Count))
If Not (intsect Is Nothing) Then
If Len(Target.Value) > 0 And Len(Target.Offset(-1, 0).Value) = 0 Then
MsgBox "You are trying to skip some cell(s) in column A"
Target.ClearContents
End If
End If
End Sub
 
Back
Top