Hello Guys, I need to create warning message box which gonna be popped up everytime when result of "look up" calculation in cell D3 is "#N/A" or cell D3 is empty.
I have tried something like this, but it is not working for me:
Then I´ve found here other code, first part worked well (box has been popped up) but if the result of calculation is OK the other part of code is not running:
I have tried something like this, but it is not working for me:
Private Sub CommandButton1_Click()
If Range("D3").Calculate = "" Then
MsgBox "Running Test "
Else:
**other part of code**
end if
end sub
Then I´ve found here other code, first part worked well (box has been popped up) but if the result of calculation is OK the other part of code is not running:
Thanks in advance for your help!Private Sub CommandButton1_Click()
If [IsError(d3)] Then
Select Case [d3]
Case CVErr(xlErrDiv0)
MsgBox "#DIV/0! error"
Case CVErr(xlErrNA)
MsgBox "Wrong data, correct it!"
Case CVErr(xlErrName)
MsgBox "#NAME? error"
Case CVErr(xlErrNull)
MsgBox "#NULL! error"
Case CVErr(xlErrNum)
MsgBox "#NUM! error"
Case CVErr(xlErrRef)
MsgBox "#REF! error"
Case CVErr(xlErrValue)
MsgBox "#VALUE! error"
Case Else
***other part of code***
end select
end if
end sub