+ Reply to Thread
Results 1 to 13 of 13

Match Headers, Copy from raw data and paste it horizontally

  1. #1
    Registered User
    Join Date
    10-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    4

    Question Match Headers, Copy from raw data and paste it horizontally

    Hi,

    Can someone please help me with this?
    I have attached a sample pic for this report.
    I am trying to create a macro to copy from raw data(first picture) according to the heading on the top(Name, Number, Subject)
    raw.JPG

    and paste it on the summary sheet (second picture) in a different direction.
    summary.JPG

    Because there will be 50+ headings, so I want to the macro to scan and match with the pre-entered headings on the summary sheet.
    And please notice the subject only requires Y or blank.

    I have been struggling a week on this. My brain is officially frozen. Please help me. @_@

    Attached is the excel file with desired result. Thanks
    sample.xlsx
    Last edited by jjjcheu; 10-22-2012 at 11:05 AM. Reason: Attached Excel file

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Match Headers, Copy from raw data and paste it horizontally

    It can be done. Please attach a sample excel book with a desired result.

  3. #3
    Registered User
    Join Date
    10-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Match Headers, Copy from raw data and paste it horizontally

    Thanks. I have attached the excel file.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Match Headers, Copy from raw data and paste it horizontally

    Sorry! This requires dictionary or collection code which is out of my skills. I did not see you had duplicates. We have few experts on dictionary on this forum and hopefully should be able to help you. This was my code for the first part.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Match Headers, Copy from raw data and paste it horizontally

    Thanks for trying! Any reference material you can provide?

    Can someone please help me with this?

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Match Headers, Copy from raw data and paste it horizontally

    If no one comes to your rescue, I will dig up and take a massive plunge to find a solution. I am sure Mike will help out if he sees this thread, if not, I promise,I will by the end of the week.

  7. #7
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Match Headers, Copy from raw data and paste it horizontally

    Give this a try

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Match Headers, Copy from raw data and paste it horizontally

    Mike! Thanks for your intervention. Unfortunately, your code is not the finished article. If you look at the attachment, there are duplicates on subject and school day. Once these two heading are transposed and splitted, they only appear one per row, hence it requires in my view a dic

  9. #9
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Match Headers, Copy from raw data and paste it horizontally

    AB33,

    Im lost??? I get the same results as the OP does in his summary sheet? Have you ran the code? have I missed something?
    Last edited by mike7952; 10-22-2012 at 06:37 PM.

  10. #10
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Match Headers, Copy from raw data and paste it horizontally

    AB33

    Because there will be 50+ headings, so I want to the macro to scan and match with the pre-entered headings on the summary sheet
    I read the OP's post as the pre-entered Headers will be listed on the summary sheet all ready? Is that not the case?

  11. #11
    Registered User
    Join Date
    10-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Match Headers, Copy from raw data and paste it horizontally

    ohh Thanks! It looks great on the sample.xlsx!
    Can you please put more comments in the code? so I can modify it on my own in the future :D

    Because I am going to have around 50 categories like "school days" and "subject", should I still use the same approach or should we scan the headers and insert the content?

    Both of your help are greatly appreciated! :D

  12. #12
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Match Headers, Copy from raw data and paste it horizontally

    I assumed from your post that column A on the summary sheet will be populated with subjects and days. So you will onle need to adjust 2 parts.

    4 to 7 are the rows where the subjects start and end on the summary sheet. So if they start in 4 but end in 30 or 40 ect.. then change it to 4 to 40 or 50
    Please Login or Register  to view this content.
    9 to 13 are the rows where the school days start and end on the summary sheet. So if they start in 40 but end in 44 ect.. then change it to 40 to 44
    Please Login or Register  to view this content.

  13. #13
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Match Headers, Copy from raw data and paste it horizontally

    Sorry Mike! You may be right!
    I think my reading and understanding was as per the attached, i.e the OP supplies the raw data ONLY and summary with no data and is expected result from raw.
    When I run your code on empty summary tab, I got a weird result.
    I wasted lots of time to find a solution. I wish the OP made it clear from the start.
    Last edited by AB33; 10-23-2012 at 12:27 PM.

+ 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