kilbey1
06-21-2007, 11:20 AM
I have a very simple function set to check a cell from another worksheet. My problem: when it encounters #N/A, I can't get the value of the cell to be replaced with "~". I know #N/A is either error.type(7) or, if undefined, 'other'.
Can someone please point me in the right direction, so I can get any error results displayed as ~ in the cell?
Function checkCellInfo(wcell As String)
wcell = Trim(wcell)
If wcell <> "" Then
'cell is not empty
If IsNumeric(wcell) Or Not Error <= 7 Then
checkCellInfo = wcell
ElseIf IsError(wcell) Then
checkCellInfo = "~"
Else
checkCellInfo = "~"
End If
Else
'check to see if there is an error
checkCellInfo = ""
End If
End Function
Can someone please point me in the right direction, so I can get any error results displayed as ~ in the cell?
Function checkCellInfo(wcell As String)
wcell = Trim(wcell)
If wcell <> "" Then
'cell is not empty
If IsNumeric(wcell) Or Not Error <= 7 Then
checkCellInfo = wcell
ElseIf IsError(wcell) Then
checkCellInfo = "~"
Else
checkCellInfo = "~"
End If
Else
'check to see if there is an error
checkCellInfo = ""
End If
End Function