+ Reply to Thread
Results 1 to 9 of 9

Macro code to pull data from different sheets based on the header of the main sheet

  1. #1
    Registered User
    Join Date
    08-16-2012
    Location
    Banglore
    MS-Off Ver
    Excel 2007
    Posts
    23

    Macro code to pull data from different sheets based on the header of the main sheet

    Hi,


    I need a macro to pull the data from different sheets (the columns are not properly alligned) to one single sheet based on the header of the main sheet. but some sheet will have the data in middle of the sheets.

    Please find the below data sheets (it has 3 sheets (Main sheet and 2 sample data sheets).


    Thanks,
    Uday kumar
    Attached Files Attached Files
    Last edited by Shanthuday; 08-16-2012 at 02:22 AM. Reason: typo error

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro code to pull data from different sheets based on the header of the main sheet

    Data transfer from data2 to Main sheet looks simple, with the code having to lookup the columns.

    What about data1? Will the headers always be in row 18? Should only the data from row 18 n 19 be included in the main sheet?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    08-16-2012
    Location
    Banglore
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Macro code to pull data from different sheets based on the header of the main sheet

    Nope.. it depends on the customer.. it may be differ from customer to customer.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro code to pull data from different sheets based on the header of the main sheet

    So should we look for the header from the main sheet in data1? Will the text of the headers match?

  5. #5
    Registered User
    Join Date
    08-16-2012
    Location
    Banglore
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Macro code to pull data from different sheets based on the header of the main sheet

    That would be better i think, and one more thing is some headers in the data sheet is not as exact as main sheet, so we should also include those condition in the lookup.

    Say for an example: Heading "CUSIP" (Data1) should come under column "SecurityNumber" of main sheet and also "Security CUSIP" (Data2) should also pull to same column.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro code to pull data from different sheets based on the header of the main sheet

    You will need to specify all those conditions.

  7. #7
    Registered User
    Join Date
    08-16-2012
    Location
    Banglore
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Macro code to pull data from different sheets based on the header of the main sheet

    Please find the attached excel which has the list of items which the customers will update for a particular header.

    Also if we can able to map this excel instead writing codes for each condition would really appriciated, which will help the users to change the data in the excel itself instead of code changes.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    08-16-2012
    Location
    Banglore
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Macro code to pull data from different sheets based on the header of the main sheet

    just to make you to understand the mapping excel which i had sent:

    Ex: "Trade Date" is the main heading and the customer can provide it as many ways which is listed under "Trade Date" column.

  9. #9
    Registered User
    Join Date
    08-16-2012
    Location
    Banglore
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Macro code to pull data from different sheets based on the header of the main sheet

    Will it possible to develop a code to pull the data into main sheet

+ 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