+ Reply to Thread
Results 1 to 3 of 3

InputBox Cancellation

  1. #1
    Registered User
    Join Date
    06-16-2008
    Location
    Arlington, VA
    MS-Off Ver
    2007
    Posts
    93

    InputBox Cancellation

    I am having trouble with the Range type of Input Box being cancelled. I am using the code below and upon cancel I receive an object required message.
    What am I doing wrong?

    Please Login or Register  to view this content.


    Thanks in advance
    Last edited by nms2130; 06-29-2010 at 12:00 PM.

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: InputBox Cancellation

    Please Login or Register  to view this content.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: InputBox Cancellation

    Hello nms2130,

    Here is another method you may be able to use. This method doesn't throw an error when the user cancels. This is because the macro uses a Variant. When the user cancels the input operation, it returns a Boolean value of False. When you select a Range, it returns a Variant Array.

    This method is useful when only the Range values are needed. If you need to access formatting, formulas, or addresses then you need to use Bob's method.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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