+ Reply to Thread
Results 1 to 12 of 12

Data extract by state

  1. #1
    Forum Contributor
    Join Date
    10-02-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2016
    Posts
    140

    Data extract by state

    Hi ..
    I need help ..

    I have a data where I need to extract the complete data based on state in column"K" into new sheet by category state
    If the data which don't have state or empty cells in column "k" or else if postcode is invalid in column "J"
    for an example the postcode can be "00000" or "000000" or "00" or it can be empty then need to extract into new sheet..

    I have attached sample data in ms excel


    Thanks
    MathanRaj
    Attached Files Attached Files

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Data extract by state

    Try the below code....

    Please Login or Register  to view this content.
    Edit: Correction In Code
    Last edited by :) Sixthsense :); 04-04-2013 at 01:10 AM.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    10-02-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2016
    Posts
    140

    Re: Data extract by state

    I have try you code but the data all empty except the header of rows is there..
    pls help me ..
    Thanks

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Data extract by state

    Download and Open the attached file and Press Alt+F8 and select the MacroName and Click Run.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    10-02-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2016
    Posts
    140

    Re: Data extract by state

    Yes..thanks It work fine for me..
    you r really good..
    I have another question
    How if i want extract the data from sheet1 to sheet2, sheet3 and so on..based on state on column"k"
    Thanks..
    Attached Files Attached Files

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Data extract by state

    Please refer the below thread for similar question / answer.

    http://www.excelforum.com/excel-prog...stersheet.html

  7. #7
    Forum Contributor
    Join Date
    10-02-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2016
    Posts
    140

    Re: Data extract by state

    But..i can't get which i want from the thread which ask me refer..
    Can u give me so attached files with it ..
    I'm still new in vba excel..

    Thanks

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Data extract by state

    You would like to get data from each sheet based on single state?

  9. #9
    Forum Contributor
    Join Date
    10-02-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2016
    Posts
    140

    Re: Data extract by state

    yes..
    for an example
    if data in sheet1 in column "K" state is "Kangar" then copy the entire data for "kangar" and paste into sheet2
    if data in sheet1 in column "K" state is "Kuala lumpur" then copy the entire data for "Kuala lumpur" and paste into sheet3 and so on..

    Thanks
    MathanRaj

  10. #10
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Data extract by state

    May be this....

    Download and Open the attached file and Press Alt+F8 and select the MacroName and Click Run.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    10-02-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2016
    Posts
    140

    Re: Data extract by state

    Actually

    what i want the data from sheet in column "k" if state is "KANGSAR" THEN COPY THE ENTIRE ROW FOR KANGSAR AND PUT INTO SHEET 2
    IF the data from sheet in column "k" if state is "KUALA LUMPUR" THEN COPY THE ENTIRE ROW FOR "KUALA LUMPUR" AND PUT INTO SHEET 3

    I have Attached sample data
    tHANKS
    Attached Files Attached Files

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

    Re: Data extract by state

    Sixthsense has provided you a code which copies the name in column "K" to each individual sheet. Why do you need now to copy them in to sheet1, sheet2? what is the reason?

+ 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