+ Reply to Thread
Results 1 to 6 of 6

inputbox (error if close)

  1. #1
    Registered User
    Join Date
    06-15-2006
    Posts
    9

    inputbox (error if close)

    I am trying to put an input box in that wont let you just push cancel, somethign MUST be input. Right now when they push cancle it just has an error in the program, but this needs to be a little more user friendly. Can i do this by having a message box pop up saying you must enter something then close that and have the inputbox still be up, or have a new input box come up that says you must enter a value and have it loop until a value is input. I have no idea how to do this though, please help.

  2. #2
    Die_Another_Day
    Guest

    Re: inputbox (error if close)

    Do
    str1 = Application.InputBox("Testing","Blah Blah")
    While str1 = False

    HTH

    Die_Another_Day
    "CatherineN" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I am trying to put an input box in that wont let you just push cancel,
    > somethign MUST be input. Right now when they push cancle it just has
    > an error in the program, but this needs to be a little more user
    > friendly. Can i do this by having a message box pop up saying you must
    > enter something then close that and have the inputbox still be up, or
    > have a new input box come up that says you must enter a value and have
    > it loop until a value is input. I have no idea how to do this though,
    > please help.
    >
    >
    > --
    > CatherineN
    > ------------------------------------------------------------------------
    > CatherineN's Profile:
    > http://www.excelforum.com/member.php...o&userid=35469
    > View this thread: http://www.excelforum.com/showthread...hreadid=560737
    >




  3. #3
    Forum Contributor colofnature's Avatar
    Join Date
    05-11-2006
    Location
    -
    MS-Off Ver
    -
    Posts
    301
    "Do...While" isn't VBA. Use:

    do while str1 = false
    str1 = Application.InputBox("Testing", "Blah Blah")
    loop


    Col

  4. #4
    Jim Jackson
    Guest

    RE: inputbox (error if close)

    If msgbox("Your Text") = VbCancel then
    msgbox("You must enter some data"),VbOkOnly
    else
    end if
    --
    Best wishes,

    Jim


    "CatherineN" wrote:

    >
    > I am trying to put an input box in that wont let you just push cancel,
    > somethign MUST be input. Right now when they push cancle it just has
    > an error in the program, but this needs to be a little more user
    > friendly. Can i do this by having a message box pop up saying you must
    > enter something then close that and have the inputbox still be up, or
    > have a new input box come up that says you must enter a value and have
    > it loop until a value is input. I have no idea how to do this though,
    > please help.
    >
    >
    > --
    > CatherineN
    > ------------------------------------------------------------------------
    > CatherineN's Profile: http://www.excelforum.com/member.php...o&userid=35469
    > View this thread: http://www.excelforum.com/showthread...hreadid=560737
    >
    >


  5. #5
    Registered User
    Join Date
    06-15-2006
    Posts
    9
    Thank you I got it to work, the logic makes sense, like any other programming language, but the syntax really still confuses me, so thanks for the help

  6. #6
    Die_Another_Day
    Guest

    Re: inputbox (error if close)

    Sry... I just winged it without testing the code. The proper syntax is:
    Do
    str1 = Application.InputBox("Testing","Blah Blah")
    Loop While str1 = False

    Die_Another_Day
    "colofnature" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > "Do...While" isn't VBA. Use:
    >
    > do while str1 = false
    > str1 = Application.InputBox("Testing", "Blah Blah")
    > loop
    >
    >
    > Col
    >
    >
    > --
    > colofnature
    > ------------------------------------------------------------------------
    > colofnature's Profile:
    > http://www.excelforum.com/member.php...o&userid=34356
    > View this thread: http://www.excelforum.com/showthread...hreadid=560737
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1