+ Reply to Thread
Results 1 to 8 of 8

[SOLVED] Select/Copy/Paste from workbook to workbook

  1. #1
    Registered User
    Join Date
    04-24-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    8

    [SOLVED] Select/Copy/Paste from workbook to workbook

    Hi All,

    I've been doing various searches for past few hours and can't seem to find out if one its even possible, the closet I've found on here is to copy row to another workbook.

    My question is I have one excel book called level1.xls and another excel book level2.xls, now in level1.xls I have a row of fields filled in and in level2.xls I have a blank form which for example I would like to try programme in VBA from the level2.xls file to click a button and open automatically level1.xls then grab field "A2" value from level1.xls and place it in level2.xls field "L4" then continue using level1.xls "B2" to level2.xls in field "C3" and then continue down when I add more values A3, A4 so on in level1.xls to the same field in level2.xls L4.

    This is kind theory at the moment so don't exactly have any excel books to attach as an example. hope this makes sense.

    Thanks for any tips or pointers.

    Steve.
    Last edited by byte; 04-25-2009 at 11:18 AM. Reason: Marking Solved.

  2. #2
    Forum Contributor GuruWannaB's Avatar
    Join Date
    01-24-2008
    Location
    An hour due East of Cowtown Ohio
    MS-Off Ver
    2010
    Posts
    421

    Re: Select/Copy/Paste from workbook to workbook

    You could record a macro to do this....or you could use a formula that references the cell in the other workbook...
    I help because of the Pavlovian dog that resides in the inner me...so if you are happy with the results, please add to my reputation. It helps keep me motivated!



    Please mark your threads as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Select/Copy/Paste from workbook to workbook

    Post up sample workbooks showing your data (a good sample, not too short) and you expected/desired results in the second book.

    Click on GO ADVANCED and use the paperclip icon to attach you workbooks.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    04-24-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Select/Copy/Paste from workbook to workbook

    Thanks for the quick response.

    I have attached 2 books, level1.xls has the "raw" data then in level2.xls is going to be a form in which I have managed to (novice vba coder btw) open level1.xls book and it activates the copy function but I'm stuck on how to get it in level1.xls to copy actual last line filled in and paste to fields in level2.xls.

    Thanks for and help with this, I hope I have explained it correctly.

    Steve
    Attached Files Attached Files

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Select/Copy/Paste from workbook to workbook

    Just to be clear, you're typing new data into level1.xls?

    In level2.xls you just want the LAST entries in level1.xls to appear when you click the button? ONLY the last entry in level1.xls?

    If so, you definitely don't need a macro for that, you can accomplish that with normal worksheet functions and level2.xls will simply HAVE the last values from level1.xls all the time.

    Is that ok? Or is there some significance "pushing the button" that makes a macro necessary?
    Last edited by JBeaucaire; 04-25-2009 at 10:36 AM.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Select/Copy/Paste from workbook to workbook

    Here's a version of your Level2.xls that simply finds the last value in Level1.xls by searching for the highest value in column A. Will this work for you? No macro, it just happens in realtime. When you open it, Excel may ask you to help it find Level1.xls if it's not open. Level1.xls does NOT have to be open.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    04-24-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Select/Copy/Paste from workbook to workbook

    Quote Originally Posted by JBeaucaire View Post
    Just to be clear, you're typing new data into level1.xls?
    That is correct.
    In level2.xls you just want the LAST entries in level1.xls to appear when you click the button? ONLY the last entry in level1.xls?
    Yes only the last entry made.

    If so, you definitely don't need a macro for that, you can accomplish that with normal worksheet functions and level2.xls will simply HAVE the last values from level1.xls all the time.
    OK, thanks for the tip.

    Is that ok? Or is there some significance "pushing the button" that makes a macro necessary?
    Yep, no significance in fact its made even easier as you miss the "push of a button" step completely.

    Thanks for your time looking at this.

    Steve

  8. #8
    Registered User
    Join Date
    04-24-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Select/Copy/Paste from workbook to workbook

    Quote Originally Posted by JBeaucaire View Post
    Here's a version of your Level2.xls that simply finds the last value in Level1.xls by searching for the highest value in column A. Will this work for you? No macro, it just happens in realtime. When you open it, Excel may ask you to help it find Level1.xls if it's not open. Level1.xls does NOT have to be open.
    JBeaucaire, you are fantastic this will work perfectly for me. I shall have a read up on how you did it.

    Thanks again!

    Steve

+ 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