+ Reply to Thread
Results 1 to 4 of 4

copy values from a worksheet to another workbook. source workbook name unknown

  1. #1
    Registered User
    Join Date
    07-30-2009
    Location
    vancouver, BC
    MS-Off Ver
    Excel 2000-2003
    Posts
    13

    copy values from a worksheet to another workbook. source workbook name unknown

    I need to copy a range of values (actually two ranges). The ranges are of fixed size. Le't say A2:D20 and E2:H20.

    Both workbooks have the exact same layout, and they both have the same named worksheet (in this case it's called Entry). However the actual filename of the source workbook is unknown. I know numerous users have changed the filename of the xls file.

    I want to instruct them to open the old and new workbook, and open a third workbook containing the copy macro, they run the macro and it copies the data.

    How can I reference a known worksheet name but of an unknown workbook name esp when the source and destination share the worksheet name?
    Last edited by sark666; 08-12-2009 at 11:04 PM. Reason: solved

  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

    Re: copy values from a worksheet to another workbook. source workbook name unknown

    Hello sark666,

    Here is an example macro. This will let the user choose where the Excel source file is stored and open it. The macro will also ask the user to open the destination workbook. The information will be copied from the source range to the destination range. Change the sheet name and ranges to what you are using. They are marked in red.
    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!)

  3. #3
    Registered User
    Join Date
    07-30-2009
    Location
    vancouver, BC
    MS-Off Ver
    Excel 2000-2003
    Posts
    13

    Re: copy values from a worksheet to another workbook. source workbook name unknown

    That works perfectly thank you!

    Can I flag a thread as solved?

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

    Re: copy values from a worksheet to another workbook. source workbook name unknown

    Hello sark666,

    How to mark a thread Solved
    Go to the first post
    Click Edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No Prefix.
    Change to Solved
    Click Save

+ 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