+ Reply to Thread
Results 1 to 7 of 7

Formatting the Master data with incorrect macro

  1. #1
    Registered User
    Join Date
    10-04-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    46

    Formatting the Master data with incorrect macro

    Hi

    I have a master data which contains the details such as country, name, ID, grade etc.
    Can anyone suggest a macro to split the master data based on the country's name and create additional sheets with this data.
    I have another macro which helps in tabulation of the data based on a certain criteria but unbale to tweak the same to fit my current simple criteria. As i am new and still learning how to use macro,kindly help me

    Below is the tweaked code which when used shows an error
    Please Login or Register  to view this content.

    Thanks

    I have attached the sample data
    Attached Files Attached Files
    Last edited by Deepa12; 12-09-2012 at 11:29 PM.

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Formatting the Master data with incorrect macro

    See my attached modified workbook and let me know if it works for what you need. I deleted your first three rows on your Master sheet so that the first row of actual data in in row 2. (Row 1 contains the row headings.)

    Once you open my modified sheet, run the macro 'CopyCountry'. If the sheet for a specific country already exists, it will add the matching data to that sheet after the last current row of data on that sheet. Since you already had 'India' and 'China' sheets, it won't create anything, it will just copy the data to them.

    If the sheet doesn't exist, it will create a new sheet with the country's name and copy the data to it.

    Your original 'Master' sheet will remain unchanged.
    The code used is as follows:
    Please Login or Register  to view this content.
    - Moo
    Attached Files Attached Files
    Last edited by Moo the Dog; 12-09-2012 at 11:34 PM.

  3. #3
    Registered User
    Join Date
    10-04-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    46

    Re: Formatting the Master data with incorrect macro

    Cool it works!! thankyou so much.....however i have one more concern which flows from the data to the next step..will get in touch with you soon.........

  4. #4
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Formatting the Master data with incorrect macro

    Glad to help. Thanks for the rep. It's always appreciated.

    - Moo

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Formatting the Master data with incorrect macro

    Deepa12

    Re: your PM

    You took a wrong code and even your modification doesn't make sense at all....
    Please Login or Register  to view this content.
    Last edited by jindon; 12-10-2012 at 01:03 AM.

  6. #6
    Registered User
    Join Date
    10-04-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    46

    Re: Formatting the Master data with incorrect macro

    Thanks Moo.......

    However when i run the macro, the first row which is the header does not appear across other sheets with the ouput data....
    can anything be done for it?

  7. #7
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Formatting the Master data with incorrect macro

    Sure, see the line I added in the code (red text). Add it in to the code in your workbook exactly where it appears below:
    Please Login or Register  to view this content.
    - Moo

+ 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