Can i restrict input in a cell until previous cell populated?

G

Gord Dibben

You most likely will remain frustrated if you cannot provide more details
than you have.

Try this sheet event code.

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "B1:B10" '<== change to suit
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Application.EnableEvents = False
With Target
If .Offset(0, -1).Value = "" Then
MsgBox "please fill in" & .Offset(0, -1).Address
.ClearContents
End If
End With
End If
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP
 

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

Top