I am relatively new to VBA.
I have a table Range(E16:DW39)
, where each Cell has a dropdown menu (Data Validation = List)
to pick a value manually BUT at the same time I have a Macro to copy data from another worksheet (two ways to populate the table).
I want to get a Message every time the user changes any cell value Manually.
I want to be able to still run the Macro (as I noticed that I cannot after adding the following code) independently. This Intersect check I want it only for the manual data input.
In order to do this check I have the following code (in the specific Sheet):
Private Sub Worksheet_Change(ByVal Target As Range)
------------------------------------------------------
Dim myRange As Range
myRange = Range("E16:DW39") '-> Mission Mix Table
If Intersect(myRange, Target) Then
MsgBox "Mission Plan is not matching with this change"
End If
End Sub
------------------------------------------------
I get the following ERROR
Run-Time Error 91: Object variable or With block variable not set
When I tried to change a cell value to another one from the dropdown menu, I get the above ERROR, any idea how to solve this problem?
Please notice that due to this code I cannot run my previously running fine Copy macro.