+ Reply to Thread
Results 1 to 6 of 6

Inputbox vs. Application.InputBox

  1. #1
    Registered User
    Join Date
    04-14-2013
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    14

    Inputbox vs. Application.InputBox

    Please Login or Register  to view this content.
    Above is my code, basically what I did was prompting an inputbox to let user enter its changing cells and then run the solver.
    Now I want user to select instead of enter cells in inputbox, hence I used Application.InputBox
    Please Login or Register  to view this content.
    however, I couldn't run the solver if I changed to application.inputbox, does anyone know is there any problem with the code?

    Thanks!!!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: Inputbox vs. Application.InputBox

    In the first example, you are inputting a string which represents a range address.

    In the second example you are actually setting x equal to a range.

    Try:

    Please Login or Register  to view this content.

    Or, you might get away with:

    Please Login or Register  to view this content.

    Regards, TMS
    Last edited by TMS; 08-06-2013 at 08:21 AM.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Inputbox vs. Application.InputBox

    Well your second inputbox will return x as a range object and the first will return a string. Presumably ByChange needs to be a string so try using:
    Please Login or Register  to view this content.
    Edit: @TMS - beat me to it but you need to remove the set command when setting x equal to the application.inputbox address

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: Inputbox vs. Application.InputBox

    @yudlugar: good spot ... that was what I intended

    Fixed now

  5. #5
    Registered User
    Join Date
    04-14-2013
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Inputbox vs. Application.InputBox

    Hey guys,

    it works well!! thank you so much!

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: Inputbox vs. Application.InputBox

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Application.Inputbox
    By Hilton1982 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-14-2012, 09:16 AM
  2. InputBox-ow to have a user input text in a inputbox
    By noodle48 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2011, 08:17 AM
  3. Screen positioning inputbox that is set as Application.InputBox
    By vdongen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-06-2010, 07:59 AM
  4. Application.inputbox
    By davegugg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-08-2009, 11:27 AM
  5. Inputbox button control + msgbox for empty inputbox
    By D_Rennie in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-30-2009, 12:39 PM

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