+ Reply to Thread
Results 1 to 15 of 15

copy paste between 2 workbooks

  1. #1
    Forum Contributor
    Join Date
    04-23-2007
    Location
    Texas
    Posts
    417

    copy paste between 2 workbooks

    I'm trying to put this together but I have no idea what I'm doing really.... I have my try hard pants on and everything..

    Please Login or Register  to view this content.
    Once the tname is found and copied, then open the other workbook and find the next blank cell and paste. Go back to HCU2 All tags update.csv and find the next tname over and over through C:C.
    Last edited by Tortus; 10-02-2013 at 02:40 PM. Reason: Solved baby

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: copy paste between 2 workbooks

    Assuming that both workbooks are already open (the macro doesn't have to open the second workbook), are both workbooks open in the same instance of excel?

    What version of windows and excel are you using?
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Forum Contributor
    Join Date
    04-23-2007
    Location
    Texas
    Posts
    417

    Re: copy paste between 2 workbooks

    2007 and yep, both workbooks would be open. I could use this code again by changing the workbook names within the VB or at least thats what I'm thinking i could possible do.

  4. #4
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007, MS 365 (Windows 10 Pro 64-bit)
    Posts
    810

    Re: copy paste between 2 workbooks

    You can try:

    Please Login or Register  to view this content.
    Regards,
    tt3

  5. #5
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: copy paste between 2 workbooks

    Or
    Please Login or Register  to view this content.

    e/ Do you need this to be adjusted to work with any workbooks?
    Last edited by Solus Rankin; 09-30-2013 at 01:14 PM. Reason: another question

  6. #6
    Forum Contributor
    Join Date
    04-23-2007
    Location
    Texas
    Posts
    417

    Re: copy paste between 2 workbooks

    The second code was exactly what I needed thank you so much! The next part would be to go the other way. If I change a value in Workingbook.xlsx - how could I keep the consistency writing the new value back to the active workbook? What I plan on doing is coping your code for many different things and have it paste in Workingbook.xlsx. Then change the value (text) and copy/paste back to the active workbook. Problem is how can I make the new value land in the active workbook in exactly the same place it came from?

  7. #7
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: copy paste between 2 workbooks

    I think you might benefit from creating a personal.xlsb, storing your macro here. These open up (hidden) every time you run Excel and allow to run the macros stored there on the active workbook (whichever workbook you have displayed on the screen at the time). It would be fairly easy to "bookmark" the cell the value was taken from so that you can return values here when you're done editing.

  8. #8
    Forum Contributor
    Join Date
    04-23-2007
    Location
    Texas
    Posts
    417

    Re: copy paste between 2 workbooks

    Ok, I'll look into bookmarking cell's. One other question, in your code how can I add more conditions?
    Please Login or Register  to view this content.
    Does this make sense what I'm asking? lol

  9. #9
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: copy paste between 2 workbooks

    Yes you can, but remember that tname is just the range the macro is looping through, its not the active cell. So you might want:

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    04-23-2007
    Location
    Texas
    Posts
    417

    Re: copy paste between 2 workbooks

    Could you do please write an example of defining something like tname and dname in one code?

    Like
    Please Login or Register  to view this content.
    Please!

  11. #11
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: copy paste between 2 workbooks

    Such as:
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    04-23-2007
    Location
    Texas
    Posts
    417

    Re: copy paste between 2 workbooks

    Please Login or Register  to view this content.
    Sorry.. I'm real slow and this doesn't work like i thought

  13. #13
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: copy paste between 2 workbooks

    Please Login or Register  to view this content.
    Is there any reason to loop twice or can you check both of them at the same time like this?

  14. #14
    Forum Contributor
    Join Date
    04-23-2007
    Location
    Texas
    Posts
    417

    Re: copy paste between 2 workbooks

    Got your PM and there was something going on with my connection. I couldn't access the forum page until today. Thank you for your help. I can play around with what you have provided and I'll post again if I have questions. This forum has helped me greatly.. wouldn't know what I would do without it

  15. #15
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: copy paste between 2 workbooks

    Glad to help.

+ 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] Open Multiple Workbooks, Record names, Copy paste to Active Workbook, Close the Workbooks
    By vba_madness in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-24-2013, 06:09 AM
  2. [SOLVED] Vba excel 2003 - copy & paste from 'master copy' workbook to 2 other workbooks
    By AliiShariff in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-24-2012, 12:58 PM
  3. Copy\Find\Copy\Paste Multiple Workbooks
    By JMcClane in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-05-2010, 10:23 AM
  4. Copy and paste between workbooks
    By Steve Boxler in forum Excel General
    Replies: 0
    Last Post: 08-25-2005, 03:05 PM
  5. Replies: 6
    Last Post: 04-05-2005, 03:06 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