I have this sheet where I want to restrict data entry to the three blocks A B C.
The code below works fine for block A. But I want to expand this code to blocks B and C, in the same Sub.
The code below works fine for block A. But I want to expand this code to blocks B and C, in the same Sub.
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim i As Integer
i = Target.Row
If i >= 1 And i <= 10 Then
If Target.Column >= 1 And Target.Column <= 4 Then
Exit Sub
Else
Application.EnableEvents = False
Cells(i, 1).Select 'col A
Application.EnableEvents = True
Exit Sub
End If
'here I want similar code for blocks B and C
End If
End Sub