+ Reply to Thread
Results 1 to 2 of 2

Select range in different workbook

  1. #1
    Registered User
    Join Date
    09-21-2004
    Posts
    9

    Question Select range in different workbook

    Cheers all!

    Could you please help me with this one:

    I need to allow the user to select a range in a different workbook than the one where the code is running.

    So, the user clicks on a button to start the application, and sees a prompt to select a range with data.
    This range will be in a different workbook from where the application is running.

    I tried the Application.Inputbox method and the RefEdit control but failed (neither allows you to select a range in a different workbook, or so i figured).

    Thank you for your time,
    Alex

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

    It would be helpful to know wether the other workbook is opened or closed. If so you simply need to qualify your range object with the workbook name and worksheet name.

    Example Referencing a Range in Another Workbook (Already Opened):

    CellValue = Workbooks("Workbook2").Worksheets("Sheet1").Range("A1").Value

    This returns the value of cell A1 in Workbook2 on Sheet1 when called from the active workbook (Assumed to be Workbook1 for this example).

    Hope this answers your question,
    Leith Ross

+ 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