+ Reply to Thread
Results 1 to 6 of 6

Loop through data on a workbook, selected it and paste in current workbook

  1. #1
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Cape Town
    MS-Off Ver
    Excel 2010
    Posts
    107

    Loop through data on a workbook, selected it and paste in current workbook

    Hi,

    I have code which basically looks at column A, loops through the data and stops when there is no longer data. While it loops, it copies what is in column A into column B.

    Please Login or Register  to view this content.
    What I want to do is expand this idea to do the same thing but to loop through data in a different workbook on a particular sheet and as it loops through it copies the data into the current workbook and once again stops when there is no data. I'm a beginner to vba so I've put together some code which may kinda give an indication of what I want to do.

    Please Login or Register  to view this content.
    Thanks in advance

  2. #2
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Loop through data on a workbook, selected it and paste in current workbook

    Hi

    Upload the source and the destination excel file... This can be done...
    Click *, if my suggestion helps you. Have a good day!!

  3. #3
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Cape Town
    MS-Off Ver
    Excel 2010
    Posts
    107

    Re: Loop through data on a workbook, selected it and paste in current workbook

    Hi,

    Here are the path names. The Destination File will be open and I would like to run the macro from here

    Source File : C:\Users\mjacob\Desktop\Source_File.xlsx

    Destination File : C:\Users\mjacob\Desktop\Destination.xlsx

    Thanks
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Loop through data on a workbook, selected it and paste in current workbook

    Just to confirm...

    You want the data in source file ie. data in col A to be copied into destination file... right?

    And one more thing :Are there more cols with data or is it only one as it is shown in the source file?

  5. #5
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Loop through data on a workbook, selected it and paste in current workbook

    Check this out:

    Destination.xlsm

  6. #6
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Cape Town
    MS-Off Ver
    Excel 2010
    Posts
    107

    Re: Loop through data on a workbook, selected it and paste in current workbook

    jraj1106,

    I'm really sorry for the late response. Your macro seems to work however there are multiple columns and I only require column A. Can you assist?

    Thanks

+ 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