+ Reply to Thread
Results 1 to 7 of 7

Copy data from a column from 3 sheets of a workbook to the column of another workbook

  1. #1
    Registered User
    Join Date
    09-25-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    9

    Copy data from a column from 3 sheets of a workbook to the column of another workbook



    Hi All,

    This is my first post. I m a novice in VBA and I seek your expert help and advice for the following problem.


    I have 2 excel workbooks, one named Source.xlsx which i receive on a monthly basis and other Destination.xlsx.

    The Source workbook has 3 sheets, which contains numerical codes on Column F (in all 3 sheets), which can increase or decrease every month. I need to copy and paste the contents of Column F from all 3 sheets of Source workbook to Column B, Sheet 1 of Destination workbook one after the other, without copying headers. Can someone help me out with a VBA code to achieve this?

    Thanks a lot.
    Archer
    Last edited by mclav; 09-27-2011 at 02:10 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Copy data from a column from 3 sheets of a workbook to the column of another work

    Archer,

    Welcome to the forum! Give the following a try:
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  3. #3
    Registered User
    Join Date
    09-25-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Copy data from a column from 3 sheets of a workbook to the column of another work

    Hi,

    Thanks for the reply.

    I get the following error - Error: Object does not support its property or method
    Please Login or Register  to view this content.
    How do I resolve this error?

    Thanks
    Archer

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Copy data from a column from 3 sheets of a workbook to the column of another work

    My mistake, should have been:
    Please Login or Register  to view this content.


    Adjusted code:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-25-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Copy data from a column from 3 sheets of a workbook to the column of another work

    Hi,

    Thanks a million!!!!

    It works like a charm

    Before I close this post as solved, I do have a question - As per my understanding, irrespective of the number of sheets, the code will retrieve the required data. If incase, I have to retrieve data from selected sheets only, what do I need to modify?, Should I mention the worksheet names in the code?

    Thanks for your time!

    Archer

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Copy data from a column from 3 sheets of a workbook to the column of another work

    Yeah, if you only need to pull data from certain sheets you would mention the sheetnames in the code. Adjusted the code so that, in this example, it will only pull data from sheets that are named Sheet1, Sheet2, or Sheet3:
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  7. #7
    Registered User
    Join Date
    09-25-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Copy data from a column from 3 sheets of a workbook to the column of another work

    Thanks a lot!!! Appreciate your help!!!

    Cheers
    Archer

+ 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