+ Reply to Thread
Results 1 to 6 of 6

Inputbox to select range in another workbook

  1. #1
    Registered User
    Join Date
    11-27-2012
    Location
    BG
    MS-Off Ver
    Excel 2003
    Posts
    21

    Inputbox to select range in another workbook

    Hi Guys,

    I am trying to create code which concatenate unique cells values within selected range and then to fill result in specific range selected with inputbox.
    The problem is that user can choose target range only within workbook from which previously were selected cells values to be concatenated.
    So my questions are:
    1. Is there any way to fill result in another workbook?

    2. Why the code return strange result when values to be concatenated are three or more digits numbers?
    - For example:
    140
    150
    160
    170
    180
    190
    200
    210

    return 140,150,160,170,180,000,000,000 or 1,401,501,601,701,800,000,000,000,000,000,000,000
    instead 140,150,160,170,180,190,200,210,210



    Please Login or Register  to view this content.
    Regards,

    Gurolito

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Inputbox to select range in another workbook

    Hi,

    I'll answer your second question first:
    Add this line of code
    Please Login or Register  to view this content.
    before this line of code
    Please Login or Register  to view this content.
    This will fix the display issue. The problem is that Excel thinks you are feeding the cell a number, so it formats the number in scientific format, which loses all information after so many digits. Then when you format the cell to display the number properly, it doesn't know what the final digits actually were, so it displays them as zeros.

    As for your first question:
    With the way that your code is setup, the only way to fill the result to another workbook is to have that workbook open in the background. Then when the prompt comes up asking where to place the result, switch to that workbook and select the cell.

    Hope this helps

  3. #3
    Registered User
    Join Date
    11-27-2012
    Location
    BG
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Inputbox to select range in another workbook

    Hi,

    Thank you for the solution and explanation regarding my second question.
    Now the result is as required.

    Regarding my first question.
    Actually I want to set target range in already opened workbooks but I cannot switch to them.
    Do you have any idea how to setup code in order to ranges from another workbooks to be optional?

    Thanks again!

    Regards,

    Guerolito

  4. #4
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Inputbox to select range in another workbook

    You don't need to use code to achieve what you want then.

    To switch to another open workbook, you just need to select the "View" tab, and then click on "Switch Windows", then select the workbook from that list, or alternatively just select the appropriate workbook from you Windows taskbar.

    Hope this helps

  5. #5
    Registered User
    Join Date
    11-27-2012
    Location
    BG
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Inputbox to select range in another workbook

    Hi ajryan88,

    I've tried the two ways you suggested but only through "View" tab and "Switch Windows" succeeded to reach target range in another workbook.
    It is not possible to switch workbooks through "Windows taskbar".
    Is it possible the reason to be that I use the code as Add-in?
    Anyway I consider the issue as solved.
    Again thanks for your help!

    Regards,
    Guerolito

  6. #6
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Inputbox to select range in another workbook

    It seems unlikely that being an add-in would be the cause of it, but perhaps I'm wrong and that is the reason.

    If you wouldn't mind, could you please click on the * next to my answer to say thanks

+ 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] Select range with InputBox. Is it possible?
    By Isabel in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-13-2013, 06:36 AM
  2. [SOLVED] Select range via Inputbox
    By nakul2617 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-21-2013, 07:46 AM
  3. Select Value from Checkbox in an InputBox
    By farmassist in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-30-2010, 06:19 PM
  4. Trouble Using InputBox Method to Select Range from Other Sheets
    By pao_e_vinho in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-23-2006, 06:48 AM
  5. Select range in different workbook
    By Alex Hatzisavas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-31-2005, 04:48 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