View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Alfredo_CPA Alfredo_CPA is offline
external usenet poster
 
Posts: 45
Default Validating a input box entry

Thanks everybody, it works now...




"Rick Rothstein" wrote:

You need to double up internal "double quotes" to print out one of them...

ActiveCell.Formula = "=IF(ISERROR(" & MyOriginalFormula & "),""" & _
myerrorvalue & """,(" & MyOriginalFormula & "))"

--
Rick (MVP - Excel)


"Alfredo_CPA" .(donotspam) wrote in message
...
Thanks Mike, your posting answered my original question. However it
doesn't
solve my problem (now I have a different one). Here is the code I'm
working
on it (jus a part of it):

If myerrorvalue = vbNullString Then
MsgBox "Nothing entered"
ElseIf IsNumeric(myerrorvalue) Then
ActiveCell.Formula = "=IF(ISERROR(" & MyOriginalFormula & "),"
&
myerrorvalue & ",(" & MyOriginalFormula & "))"
Else.............

Here I need a code that put the tex entered by user but ading quotation
marks , e.g. if the user put hi, my formula in excel should be:
=IF(ISERROR(+D10/E10),"hi",(+D10/E10))

"Mike H" wrote:

Hi,

Something along these lines

response = InputBox("Input some value")
If response = vbNullString Then
MsgBox "Nothing entered"
ElseIf IsNumeric(response) Then
MsgBox "Number entry"
Else
MsgBox "Text entry"
End If

Mike

"Alfredo_CPA" wrote:

I'm using excel 2003
I have an input box that allows the suer to enter a variable.
I need a code that validates the "type of entry" the user types. I.e.
if the
input is a number I need the code to do an specific action, but if the
user
types a "legend/word", I want the code to do a different action.
My problem is not with the if structure, my problem is the code to
validate
the type of entry...

--
thanks