The range indicated in the code below contains a VLOOKUP
formula. The code is meant to notify the user if VLOOKUP
returns a #N/A
.
However, I get a Type Mismatch error on the Case CVErr(xlErrNA)
line below. Why? How can I fix this?
Private Sub Worksheet_Calculate()
Dim c As Range
For Each c In Range("N7:N13,N30:N36,N53:N59,N85:N91,N108:N114,N137:N137")
Select Case [c]
Case CVErr(xlErrNA)
MsgBox "hello"
End Select
Next c
End Sub
CVErr
andxlErrNA
variables? – lowak[
square brackets]
? – Jean-François Corbett