+ Reply to Thread
Results 1 to 5 of 5

InputBox: Cancel/X properties

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,192

    InputBox: Cancel/X properties

    This macro adds a comment to a cell and some text from an input box. I store the last value entered in the input box via the registry, it is recalled as the default input box value.

    How do I capture the cancel property (Boolean, true or false?) so the ActiveCell.Value remains and comment is not added?

    When a user selects Cancel/X the macro deletes the value in the cell and add's a comment. This overwrites existing data with "" (nothing).

    The VBA help file wasn't very helpful, or, I did not know what to look for.

    Please Login or Register  to view this content.
    Any hints, tips or examples are appreciated.
    Last edited by Rick_Stanich; 10-08-2009 at 04:47 PM.
    Regards

    Rick
    Win10, Office 365

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: InputBox: Cancel/X properties

    If you use Application.Inputbox rather than Inputbox, then the Cancel returns False rather than "". If "" is not acceptable anyway, then uset eh version you have and just check that the length of the returned value is greater than zero.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,192

    Re: InputBox: Cancel/X properties

    I think understand your post, but I recall the last value (default value) thus the length will always be greater than zero.

    Using application.inputbox sets the cell value to "False" when I use the Cancel button? (overwrites the cell value).

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: InputBox: Cancel/X properties

    There's no cell value involved - your variable will be set to False if you use the Application version

  5. #5
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,192

    Re: InputBox: Cancel/X properties

    Now you did it! You made me think!

    Thank you.

    Please Login or Register  to view this content.
    Last edited by Rick_Stanich; 10-08-2009 at 04:51 PM.

+ 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