Dont allow blank

  • Thread starter Thread starter nowfal
  • Start date Start date
N

nowfal

Hi,
I would like to know how can i prevent a cell being blank. It i
like as follows:
I have colomn I,J,K,L . If colomn I is blank J,K,L should not take an
data, otherwise a message should come like you cannot keep the the cel
blank like that. Is it possible to do so. Any suggestion will be highl
helpful.
thank you
nowfa
 
Hi
only possible with VBA using an event procedure before closing/saving
the file
 
You can use this event in a worksheet module

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Cells(Target.Row, 1) _
.Range("J1,K1,L1"), Target) Is Nothing Then
If Cells(Target.Row, "I") = "" Then
MsgBox " sorry the I column is empty"
Application.EnableEvents = False
Target.Value = ""
Application.EnableEvents = True
End If
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top