D
Dave F
The following UDF gives a type 13 error when using XL 2007:
Function SetTemp1(Temp, Temp1)
Dim ss As String
If Temp = Temp1 Then ' Constant not a number
SetTemp1 = Temp
ElseIf Val(Temp) = Temp1 Then 'constant number
SetTemp1 = Temp1 * 2
Else ' Formula
ss = Temp
If Left(ss, 1) = "=" Then ss = Right(ss, Len(ss) - 1)
SetTemp1 = "=(" & ss & ")*2"
End If
End Function
The debugger highlights If Temp = Temp1 Then ' Constant not a
number
as causing the error.
I received this workbook from someone else, so I'm not too clear on
what this UDF is supposed to do or what is causing the error.
Thoughts?
Dave
Function SetTemp1(Temp, Temp1)
Dim ss As String
If Temp = Temp1 Then ' Constant not a number
SetTemp1 = Temp
ElseIf Val(Temp) = Temp1 Then 'constant number
SetTemp1 = Temp1 * 2
Else ' Formula
ss = Temp
If Left(ss, 1) = "=" Then ss = Right(ss, Len(ss) - 1)
SetTemp1 = "=(" & ss & ")*2"
End If
End Function
The debugger highlights If Temp = Temp1 Then ' Constant not a
number
as causing the error.
I received this workbook from someone else, so I'm not too clear on
what this UDF is supposed to do or what is causing the error.
Thoughts?
Dave