티스토리 뷰



Function 
IFERROR2(WriteFormula, WriteAnswer)
Dim Answ As Variant
On Error Resume Next
Answ = Application.Evaluate(WriteFormula)
If Not (IsError(Answ)) Then
     
IFERROR2 = Answ
Else
Select Case Answ
     Case CVErr(xlErrDiv0):   IFERROR2 = WriteAnswer
     Case CVErr(xlErrNA):     
IFERROR2 = WriteAnswer
     Case CVErr(xlErrName):   
IFERROR2 = WriteAnswer
     Case CVErr(xlErrNull):   
IFERROR2 = WriteAnswer
     Case CVErr(xlErrNum):    
IFERROR2 = WriteAnswer
     Case CVErr(xlErrRef):    
IFERROR2 = WriteAnswer
     Case CVErr(xlErrValue):  
IFERROR2 = WriteAnswer
     Case Else:               
IFERROR2 = Answ
End Select
End If
End Function
댓글
댓글쓰기 폼