Mr Rothstein had provided me with a nice sub (below) but I need to adjust it to just check columns ABCDGH and not A to J as the original sub. He might be very busy and I would not like to impose too much but I needed the adjusted sub as soon as possible.
so sorry if I've been too pesky..my apologies to the moderator..
many many thanks
Private Sub Worksheet_Change(ByVal Target As Range) Dim Cell As Range On Error GoTo OutOfRange If Target.Row = 2 And Target.Offset(1) = "" Then Exit Sub For Each Cell In Intersect(Target, Columns("A:J")) If Application.CountIf(Range(Cells(2, Cell.Column), Cell.Offset(-1)), "") Or (Cell.Value = "" And Cell.Offset(1).Value <> "") Then MsgBox "You cannot enter a value in a column if one of the cells above it entry cell is blank nor can you delete the contents of a cell if there is a non-blank cell below it!" Application.EnableEvents = False Application.Undo Application.EnableEvents = True Exit For End If NextOutOfRange:End Sub
so sorry if I've been too pesky..my apologies to the moderator..
many many thanks
Private Sub Worksheet_Change(ByVal Target As Range) Dim Cell As Range On Error GoTo OutOfRange If Target.Row = 2 And Target.Offset(1) = "" Then Exit Sub For Each Cell In Intersect(Target, Columns("A:J")) If Application.CountIf(Range(Cells(2, Cell.Column), Cell.Offset(-1)), "") Or (Cell.Value = "" And Cell.Offset(1).Value <> "") Then MsgBox "You cannot enter a value in a column if one of the cells above it entry cell is blank nor can you delete the contents of a cell if there is a non-blank cell below it!" Application.EnableEvents = False Application.Undo Application.EnableEvents = True Exit For End If NextOutOfRange:End Sub