dcsimg
Results 1 to 2 of 2

Thread: [RESOLVED] Error: Conversion from string "" to type 'Integer' is not valid

  1. #1

    Thread Starter
    Hyperactive Member BrianPaul's Avatar
    Join Date
    Aug 2007
    Posts
    294

    Resolved [RESOLVED] Error: Conversion from string "" to type 'Integer' is not valid

    I have an InputBox where I want someone to input a number. The number would be an integer. The line looks like this...

    amount1 = InputBox("how many?", "how many?")

    If they click cancel, it errors out because it can't convert blank ("") to an int. How can I do this with InputBox and not get that error? Or should I do it another way?

  2. #2

    Thread Starter
    Hyperactive Member BrianPaul's Avatar
    Join Date
    Aug 2007
    Posts
    294

    Re: Error: Conversion from string "" to type 'Integer' is not valid

    maybe I should do something like this...

    strTemp = InputBox("how many?", "how many?")

    If strTemp Not = "" Then amount1 = strTemp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width