+ Reply to Thread
Results 1 to 12 of 12

Cleaning and Consolidating Multiple Worksheets

  1. #1
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    522

    Cleaning and Consolidating Multiple Worksheets

    Dear Experts
    I am trying to consolidate data from multiple sheets of one workbook put it in one place but with some modifications so that it can be exported to access afterwards. I am seeking help on a macro which will do the following:
    1. Delete contents of column A
    2. In A3 Type a formula “=LEFT(B3,14)” this will become the column header
    3. Then it will go to cell A5 and again type a formula “=IF(B4="",B5,A4)” and copy it all the way down
    4. Then it should insert two columns A and B and then go to A3 Type Data I as header and in B3 type Data II as header
    5. Each worksheet has a name like XXXXX – A or XXX – B. I want to populate column a with all the characters before – in column A and single character after – in column b
    6. Copy entire sheet paste special values
    7. Insert Two more column A and B
    8. Delete Column P
    9. Delete Column S
    10. Delete Colum AE
    11. Go to column F
    12. Delete all the rows if column F is blank and also delete all the rows where text is BOLD (since these are sub headers)
    -------- I can stop here and do the following manually ------------------
    13. Now starting from column G till AD we have 24 months data and headers are Jan-12, Feb-12…… Dec-13
    14. Instead of having it across the columns it should be in rows I mean I would cut all the columns after G (H till AD) and paste them down after leaving a blank row to identify that month has changed and do it till all the data is in column G
    15. Populate Column A and B (Year & Month) with the headers of each column pasted in column G
    16. Copy and paste column C,D,E & F columns ( as they remain same)

    This will clean up the sheet and I will do the same with other sheet and then have all info in 7 columns instead of having it in 30 columns and 25 worksheets
    Purpose of cleaning and consolidating the sheets is to create a Pivot Table.
    Thanks in advance/VKS
    Last edited by VKS; 01-03-2013 at 01:15 AM.

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

    Re: Cleaning and Consolidating Multiple Worksheets

    VKS,
    You are highly unilkley to get any response as you have a project, not a question. I would suggest you need to split your requests on chunks, let say 1-3 request at a time. It is also a good idea if you could attach a sample workbook.

  3. #3
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    522

    Re: Cleaning and Consolidating Multiple Worksheets

    Thanks a lot for your advise AB33. Shall i keep this post or delete it.
    I shall try this using record macro

  4. #4
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    522

    Re: Cleaning and Consolidating Multiple Worksheets

    One more thing. Do you think you can help me with step 5 (I dont know how to do that using record macro)

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

    Re: Cleaning and Consolidating Multiple Worksheets

    5.
    "Each worksheet has a name like XXXXX – A or XXX – B. I want to populate column a with all the characters before – in column A and single character after – in column b". Please attach a sample

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,692

    Re: Cleaning and Consolidating Multiple Worksheets

    Try this on a copy of your workbook for question #5


    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    522

    Re: Cleaning and Consolidating Multiple Worksheets

    Dear Jolivanes, It gives me a runtime error 1004
    Unable to get the search property of the worksheet function class

    Will attach a file in a cpl of minutes.
    Thanks/VKS

  8. #8
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    522

    Re: Cleaning and Consolidating Multiple Worksheets

    Dear AB33 & Jolivanes,
    Attached, please find the sample file.
    Best Regards/VKS
    Attached Files Attached Files

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

    Re: Cleaning and Consolidating Multiple Worksheets

    VKS,
    This code should work, but you need to have heading in each sheet as you now have in the first sheet. In sheet C, you also need to have values in column C, as you now have in sheet1. I have tested it in product sheet as you have all the data.
    Please Login or Register  to view this content.
    Last edited by AB33; 12-31-2012 at 05:12 AM.

  10. #10
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    522

    Re: Cleaning and Consolidating Multiple Worksheets

    Thanks AB33 & Jolivanes. You have my stars for helping me on this.

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

    Re: Cleaning and Consolidating Multiple Worksheets

    VKS,
    You are welcome!
    Please close this thread as solved and start a new one with more of your questions.

  12. #12
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    522

    Re: Cleaning and Consolidating Multiple Worksheets

    Dear AB33,
    I wont shy away from the fact that I have created ugliest 6 macros using record macro but I am still proud of achieving what I have done for myself. By running all these macros together I do reach closer to my desired output.
    To be honest I want someone to look at entire thing ( Which is not long but appears long as I have gone in details to explain my problem) so that I can learn what should have been done instead of what actually has been done.
    Honestly I want to wait for couple of days hoping some expert can teach me what I want to learn. If there is no full answer for me to compare what I have done and what should have been done then i will mark this as solved on 03Jan13.
    Having said all that I must thank you once again for splitting the name of the workbook.
    Best Regards/VKS

+ 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