ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Can i restrict input in a cell until previous cell populated? (https://www.excelbanter.com/excel-discussion-misc-queries/250326-can-i-restrict-input-cell-until-previous-cell-populated.html)

FRUSTRATED_WITH_EXCEL

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


Gord Dibben

Can i restrict input in a cell until previous cell populated?
 
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

On Mon, 7 Dec 2009 06:42:01 -0800, FRUSTRATED_WITH_EXCEL
wrote:




All times are GMT +1. The time now is 05:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com