I came across a problem with my workbook where the best solution I can think of would be this:
I need to prevent data from being entered anywhere else on a worksheet unless Cell X1 receives data first - anywhere else, that is, except for Cells U6, O79, U86, O159, U166, and O239.
How do I edit my existing code to do this?
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableAutoComplete = IIf(Not Intersect(Range("A9:A76,A89:A156,A169:A236"), Target) Is Nothing, False, True)
With Range("X1")
If .Value = Empty Then
Application.EnableEvents = False
.Select
MsgBox "Please enter the number of pages required before entering data elsewhere."
Application.EnableEvents = True
End If
End With
End Sub
Bookmarks