+ Reply to Thread
Results 1 to 19 of 19

Extracting information between two sheets and place it in 3 columns

  1. #1
    Registered User
    Join Date
    11-15-2014
    Location
    Belgrade
    MS-Off Ver
    Microsoft Excel 2007
    Posts
    11

    Extracting information between two sheets and place it in 3 columns

    Hi everyone,

    I have a certain data in excel sheet which i want to extract into three columns.

    here is the raw data. It's a comma separated values file (csv).

    This is what it should be the final result, after formatting the raw data:

    on sheet "Formatted_2000", you can see that there is an information from column A to column U.

    The information column A to column L was easy one. I have done "text-to-columns" to separate them by ID, Last Name, First Name, Birth Date and so on..

    But you can see at the "RAW_2000" sheet what is left - unsorted raw data.

    On sheet "Formatted_2000" I've made columns M to U and put the information manually.

    It took me a lot time to do it, so I am searching another way to sort it like this.


    I'd be very grateful if you can suggest an options on how to proceed further.
    Attached Files Attached Files
    Last edited by JBeaucaire; 11-15-2014 at 12:31 PM. Reason: Merging posts to set replies to zero

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Extracting information between two sheets and place it in 3 columns

    Hi Tricky,

    I may have something for you tomorrow
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    11-15-2014
    Location
    Belgrade
    MS-Off Ver
    Microsoft Excel 2007
    Posts
    11

    Re: Extracting information between two sheets and place it in 3 columns

    Hi xladept,

    I'd appreciate that!


    Tricky

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Extracting information between two sheets and place it in 3 columns

    Hi Tricky,

    Welcome to the Forum! To run this you need to add a sheet called "Sheet1" etc.


    Please Login or Register  to view this content.

    Directions for running the routine(s) just supplied

    Copy the code to the clipboard

    Open your Workbook

    Press ALT + F11 to open the Visual Basic Editor.

    Select "Module" from the Insert menu

    Type "Option Explicit" then paste the code under it

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name

  5. #5
    Registered User
    Join Date
    11-15-2014
    Location
    Belgrade
    MS-Off Ver
    Microsoft Excel 2007
    Posts
    11

    Re: Extracting information between two sheets and place it in 3 columns

    Hey,

    Thank you! Nailed it ! I've checked a few rows with the already Formatted 2000 data and it seems everything is okay !

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Extracting information between two sheets and place it in 3 columns

    Your welcome!


    But, because of the input - you'll still need to do some manual adjustments

  7. #7
    Registered User
    Join Date
    11-15-2014
    Location
    Belgrade
    MS-Off Ver
    Microsoft Excel 2007
    Posts
    11

    Re: Extracting information between two sheets and place it in 3 columns

    Yes, of course.

    There are cases with 3 or even 4 universities, so I have to check the degrees and search the people without education info

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Extracting information between two sheets and place it in 3 columns

    Yeah - I've got 4 on my resume.

    Have Fun!

  9. #9
    Registered User
    Join Date
    11-15-2014
    Location
    Belgrade
    MS-Off Ver
    Microsoft Excel 2007
    Posts
    11

    Re: Extracting information between two sheets and place it in 3 columns

    I haven't got time to see it in depth. Although, I'll try to make it on Python, think it's much easier than VB.

    Also, I have to create a small database for the grades, to pick the greatest and the least of them.

    Thanks again.

  10. #10
    Registered User
    Join Date
    11-15-2014
    Location
    Belgrade
    MS-Off Ver
    Microsoft Excel 2007
    Posts
    11

    Re: Extracting information between two sheets and place it in 3 columns

    Hey,

    It seems something went wrong with the data again.

    It didn't extract the information in the right sequence.

    It extracts only one of the line between ##EDUCATION### and ###END###

    Also it doesn't read the "Birth Date" properly.

    Can you help?


  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Extracting information between two sheets and place it in 3 columns

    Hi Tricky,

    Try this:

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    11-15-2014
    Location
    Belgrade
    MS-Off Ver
    Microsoft Excel 2007
    Posts
    11

    Re: Extracting information between two sheets and place it in 3 columns

    Hey,

    I'll try the second code as well. Thanks again.

    Although, I've managed to fix it with the first one.


  13. #13
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Extracting information between two sheets and place it in 3 columns

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  14. #14
    Registered User
    Join Date
    11-15-2014
    Location
    Belgrade
    MS-Off Ver
    Microsoft Excel 2007
    Posts
    11

    Re: Extracting information between two sheets and place it in 3 columns

    It does indeed, but I have one more case:

    For some of the cases between ###EDUCATION and ###END### I have several universities with different degrees and their gradations is like this:

    If we have, for instance, 3 universities with 3 degrees: The last one before ###END### row is the first university attended by the person. The first one after ###EDUCATION###, if we have more than 1 line, is the last university and probably the highest degree.

    ###EDUCATION###
    PhD, Yale University(3) - HIGHEST
    MA, University of Pennsylvania (2)
    BA, Delaware State College (1)
    ###END###


    Is it possible to rearrange the code somehow to take the first one (1) and If there are more than 2 lines, to take the 3rd or the 4th, because it will be the highest. I have to fullfil the Highest degree .

    You can see where column "Highest degree" is placed on the Sample.xlsx file.

    I think the idea is to make a database with the degrees, but since there is a gradation in the raw data(education), i think it would be better to take it directly from it.

    I know I am starting to get annoying, but it would minimze my workings to only do the researches with the missing data.

    Would appreciate that !

    Cheers,
    Ivan

  15. #15
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Extracting information between two sheets and place it in 3 columns

    Hi Tricky,

    Have you tried my last version - I think it takes care of the first and last degree!

  16. #16
    Registered User
    Join Date
    11-15-2014
    Location
    Belgrade
    MS-Off Ver
    Microsoft Excel 2007
    Posts
    11

    Re: Extracting information between two sheets and place it in 3 columns

    Hi xladept,

    Yes, I've tried it and now the universities are missing

  17. #17
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Extracting information between two sheets and place it in 3 columns

    Tricky.xlsx- this is what I've got

  18. #18
    Registered User
    Join Date
    11-15-2014
    Location
    Belgrade
    MS-Off Ver
    Microsoft Excel 2007
    Posts
    11

    Re: Extracting information between two sheets and place it in 3 columns

    Yes, it works with this example. I tried with the same structured raw data and the same sheets, but for another state - IDAHO(ID) - it didn't work.

    Let me try it one more time and I will post the result here.


    EDIT 1: It is working. I've checked 2-3 people with different education and it does take the greatest degree.

    Amazing script!

    Thank you one more time. Case solved !
    Last edited by Tricky99; 11-18-2014 at 04:35 PM.

  19. #19
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Extracting information between two sheets and place it in 3 columns

    You're welcome and thanks for the rep!

+ 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. Extracting Row Information if Value appears in Columns to List under Column Heading
    By cristame in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-10-2013, 11:26 AM
  2. Replies: 5
    Last Post: 04-17-2013, 10:55 AM
  3. Replies: 8
    Last Post: 02-13-2012, 06:35 PM
  4. Extracting information from several sheets
    By toggen in forum Excel General
    Replies: 3
    Last Post: 04-21-2008, 08:41 AM
  5. [SOLVED] Extracting cell information from various sheets to a master list
    By JackR in forum Excel General
    Replies: 0
    Last Post: 03-20-2006, 10:55 AM

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