tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,935
- Office Version
- 365
- 2019
- Platform
- Windows
This code will display the value if ONE cell is changed:
If multiple cells are selected and a value is entered by pressing SHIFT + ENTER, the above code returns an error, as expected.
I want to capture that error like this:
but it seems it never to hit the error part, even though if I typed:
in the Immediate Window, it does show an error message:
How can I capture such an error?
Thanks
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Debug.Print Target.Value
End Sub
If multiple cells are selected and a value is entered by pressing SHIFT + ENTER, the above code returns an error, as expected.
I want to capture that error like this:
Code:
If IsError(Target.Value) Then .....
but it seems it never to hit the error part, even though if I typed:
Code:
Target.Value
in the Immediate Window, it does show an error message:
Code:
Run-time error '91'
Object variable or With block variable not set
How can I capture such an error?
Thanks