Annoying Pop up box in function

S

silvest

well, a popup box in a function is like when running a function, say
"IF" function..

a input box will pop up asking for "Logical test", "Value if true", an
"Value if false"

mine only has one input box which is labelled (XX)... and the proble
is as mentioned abov
 
D

Dick Kusleika

Okay, I get it now. You're using Insert > Function from the menu.

My advice is to remove the message boxes from your function. If you want to
show a descriptive error message, then make your function return that error
message

Function ConvertDate(lInput as Long) as Variant
Select Case lInput
Case Is < 1000
ConvertDate = "Error: Input too small"
'Other cases
End Select
End Function

If you really want message boxes, the Len test worked for me

Function ConvertDate(xx)

If Len(xx) > 4 Then
Select Case xx
Case Is < 1000
MsgBox "blah"
End Select
End If

End Function

did not show a message box as I was typing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top