+ Reply to Thread
Results 1 to 20 of 20

Macro for extracting data to another work sheet

  1. #1
    Registered User
    Join Date
    11-30-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Macro for extracting data to another work sheet

    im an admin and this macro makes my life easy..so i appreciate if you help me write the code

    Lets say we have these columns

    Sarah Smith 1234566 UK
    Homer Simpson 3456677 USA
    Max Power 4567932 Canada
    Meg Griffin 5689321 USA
    Maple Canucks 9864221 Canada
    So I wanna exctract all data regarding USA in one worksheet, UK in another and Canada in another.. First how do you do it? I wanna make a macro so in future if i add more names it automatically adds to appropriate worksheet (country)

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Macro for extracting data to another work sheet

    How is the data structured? Cells in different columns or e.g. 3 columns of data?

    It would help if you uploaded your workbook example with your wanted output ("before" and "after")

  3. #3
    Registered User
    Join Date
    11-30-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Macro for extracting data to another work sheet

    Since it has office info I cant
    Here is my sheet1


    ColumnA ColumnB ColumnC
    Name Student# Country
    Sarah Smith 1234566 UK
    Homer Simpson 3456677 USA
    Max Power 4567932 Canada
    Meg Griffin 5689321 USA
    Maple Canucks 9864221 Canada
    So I wanna extract all data regarding USA in one worksheet, UK in another and Canada in another.. First how do you do it? I wanna make a macro so in future if i add more names it automatically adds to appropriate worksheet (country)

  4. #4
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Macro for extracting data to another work sheet

    I'll have a look

  5. #5
    Registered User
    Join Date
    11-30-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Macro for extracting data to another work sheet

    You are AMAZING! thank you

  6. #6
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Macro for extracting data to another work sheet

    I hope that the attached workbook example will work
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Macro for extracting data to another work sheet

    The coding behind it:

    Please Login or Register  to view this content.
    Last edited by berlan; 11-30-2013 at 11:06 PM.

  8. #8
    Registered User
    Join Date
    11-30-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Macro for extracting data to another work sheet

    I CAN NOT Thank you enough..i was entering oe by one by hand..ugh
    WOW THANK YOU THANK YOU THANK YOU

  9. #9
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Macro for extracting data to another work sheet

    Glad to help

  10. #10
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Macro for extracting data to another work sheet

    Hi..

    Heres an alternative that uses autofilter in a self contained Sub..

    The unique values that are used in the autofilter criteria come from a method i have seen Jindon use..
    Please Login or Register  to view this content.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    11-30-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Macro for extracting data to another work sheet

    THANK YOU! You guys are AMAZING

  12. #12
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Macro for extracting data to another work sheet

    Hi..

    I wanna make a macro so in future if i add more names it automatically adds to appropriate worksheet (country)
    I missed that part.. I added a "Transferred" column.. so now.. whenever a row gets transferred.. it gets a "Y" shown beside it..

    Only rows that have NOT been transferred (have no "Y" next to them) will be transferred next time you run it.. so in essence.. you can keep your Master list in tact (adding to it at will) and have no duplicates on your Country sheets..

    Heres a slight improvement..
    Please Login or Register  to view this content.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    11-30-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Macro for extracting data to another work sheet

    well, I was wrong, country is on first column no 3rd..I changed the 3 in 1 but things got screwed up
    @apo, I tried your original code works on small scale,in big scale it elimnates a column in each sheet.. second code , showed random weird stuff

  14. #14
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Macro for extracting data to another work sheet

    Hi.. both of my codes worked for me using the sample workbook you gave..
    If you are having issues applying the code to s larger/different workbook, probably best if you can attach your real which with anoninised data.._

  15. #15
    Registered User
    Join Date
    11-30-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Macro for extracting data to another work sheet

    this is the file..i want each person has hs a sheet based on name, and show column 2-end for each person name
    Attached Files Attached Files
    Last edited by canucks; 12-02-2013 at 03:59 AM.

  16. #16
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Macro for extracting data to another work sheet

    Click on the "Go Advanced" button which is below to the right of the "Quick Reply" box..

    Then Click on the "Manage Attachments" button..

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

    Re: Macro for extracting data to another work sheet

    canucks

    Try
    Please Login or Register  to view this content.
    It is too risky for the OP to receive the suggestion when the poster doesn't really understand what it does....

  18. #18
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Macro for extracting data to another work sheet

    Hi Jindon..

    I presume you refer to this code..
    Please Login or Register  to view this content.
    ?

    Mate.. I am doing the best i can.. been active with VBA (as a hobby) for only about 8 months now.. so I feel i am progressing ok..

    I did ask in another thread (on Ozgrid), if you could explain exactly what that code is doing.. but you must have missed it.. I know you are quite busy answering heaps of posts..

    So .. for now.. it is a means to an end.. it finds me uniques in a column.. and does it well... but yes.. I would love to understand what it does.. (seriously.. who wouldn't?).. care to share with all of us?

    Cheers

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

    Re: Macro for extracting data to another work sheet

    Quote Originally Posted by apo View Post
    Mate.. I am doing the best i can.. been active with VBA (as a hobby) for only about 8 months now.. so I feel i am progressing ok..
    8 month, 10 years doesn't matter.
    You should not post a code as a "Solution" for someone else's problem when you don't know what/how it does.
    You should practice for yourself and find out what it does from the web before you post.
    So .. for now.. it is a means to an end.. it finds me uniques in a column.. and does it well... but yes.. I would love to understand what it does.. (seriously.. who wouldn't?).. care to share with all of us?
    It creates as array of unique value converted from array formula through Evaluate method.
    It has a limitations.

  20. #20
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Macro for extracting data to another work sheet

    k.. thanks for the advice.. really appreciate it..

    but I must say.. everything i have learn in regards to VBA is from forums like this one.. so when you see something that "does the job".. and does it really effectively.. its so tempting to dabble in it.. even when (as you pointed out).. the what and how is unknown...

    But yes.. practice makes perfect.. I will agree..

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 07-25-2012, 07:55 AM
  2. [SOLVED] Need Macro to copy data from a single sheet from work books in the same directory.
    By bird970 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2012, 06:10 PM
  3. Macro to copy and paste data from one work sheet to another using a reference
    By Natechamb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-09-2011, 10:57 AM
  4. Macro to copy over and paste data in to a work sheet from a closed workbook
    By munkee in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-24-2009, 04:04 AM
  5. Extracting data from 1 work sheet to another
    By uspak in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-19-2005, 07:17 AM

Tags for this Thread

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