Hi all,
I'm a VBA beginner and have been following this youtube video (
) by Excel for Freelancers to make a template similar to my needs.
At about the 48 minute mark, this private sub was made to prevent a user from editing more than one cell at once:
I followed the instructions, inserting the above into the correct sheet. However, nothing happens when I edit more than one cell (e.g. delete the contents of two cells at once)? No errors are flagged when I run the code.
Any thoughts? I've tried searching other forums but can't find a solution.
Thanks
I'm a VBA beginner and have been following this youtube video (
At about the 48 minute mark, this private sub was made to prevent a user from editing more than one cell at once:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("D4:K6")) Is Nothing Then
If Target.Count > 1 Then
Application.ScreenUpdating = False
Application.Undo
Application.ScreenUpdating = True
End
End If
End If
End Sub
I followed the instructions, inserting the above into the correct sheet. However, nothing happens when I edit more than one cell (e.g. delete the contents of two cells at once)? No errors are flagged when I run the code.
Any thoughts? I've tried searching other forums but can't find a solution.
Thanks