+ Reply to Thread
Results 1 to 6 of 6

Google CSV Contacts, Organizer macro

  1. #1
    Registered User
    Join Date
    03-27-2016
    Location
    Saudi Arabia
    MS-Off Ver
    2013
    Posts
    3

    Question Google CSV Contacts, Organizer macro

    I cross almost all excel post in the Internet, and I really need your help in this please.
    I do not have expertise in scripting, but I am looking forward to give a help on my case.

    I have all my contacts in google contact CSV which shows an address in separate rows "I don't know my but it is their format". However, the key point in this file is the date that it is all of it in column (A) only with a comma separated, and the good news is the person name is always repeated in each contact, like (Harry,Harry) but also, the word "work" is repeated like (work,Fax,work,Tel). Now the pain point is the address which comes in multiple rows depend on the address details.
    The goal is to run a multi tasking macro to consolidate the data in one cell with all contact details. For Example, The macro starts with A1 and check the first word against the next word after the comma. If we have a match, then this is a contact name like (Harry,Harry,Group,Friends) and put it in Z1.

    Then check the next cell A2 for the same, if we didn't find a match (PO Box,000), then this is an address, so macro will merge A2 with A1 in a comma separated as it is a CSV to be like (Harry,Harry,Group,Friends,PO Box,000) and put the result in Z1.

    This file itself is like:

    A
    1 Harry,Harry,VIP Group,
    2 Work,Central Region,Work,+1xxx,
    3 Potter,Potter,Friends,
    4 Jack,Jack,Central Region,
    5
    6 Work Group,
    7 Work,Tel,+1xxx,

    And the result I dream of like:

    Z
    1 Harry,Harry,VIP Group,,Work,Central Region,Work,+1xxx,
    2 Potter,Potter,Friends,
    3 Jack,Jack,Central Region,,,Work Group,,Work,Tel,+1xxx,


    What I'm doing now, Extract Duplicates in a reference column (Y) to know that start and end point by using the VBA from this link, that shows the word "work" as duplicate.
    Extract Duplicates VBA, Thanks for "Matt Rogers" http://www.mrexcel.com/forum/excel-q...word-cell.html

    Then merge the cells manually for each contact in a other referance column (Z) using the VBA form this link.
    Cell Merge VBA, Thanks for "Jon Acampora" http://www.excelcampus.com/keyboard-...ange-of-cells/

    Then I copy the column (Z) and past it in the same column as values to avoid coping the formula and get the data only.
    Then I do a manually cleaning job to remove the blank rows which haven't data.
    Then delete the columns from (A) to (Y) to start working on the sheet.


    Sorry for my long question, and I do appreciate everyone trying to help.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Google CSV Contacts, Organizer macro

    Hello martel_9,

    Welcome to the Forum!

    Add a new VBA module to workbook. Copy and paste the macro code below into the module.

    This macro assumes cell "A1" on "Sheet1" contains a name like "Harry,Harry". Case is ignored as are spaces before and after the comma.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    03-27-2016
    Location
    Saudi Arabia
    MS-Off Ver
    2013
    Posts
    3

    Re: Google CSV Contacts, Organizer macro

    Hi Leith Ross,
    Thanks very much for your kind help, I tried your macro and it have some small issue as it stops at row 223 while the file is almost 4000 rows "not organized".
    I attach a sample of the file, and really appreciate your help.
    Last edited by martel_9; 03-29-2016 at 04:45 AM. Reason: miss typo

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Google CSV Contacts, Organizer macro

    Hello martel_9,

    Thanks for posting an example. Using it as a guide, I changed and tested the macro below. The result was 3 rows of CSV text.

    Delete the old code in your VBA module and replace it with the code below.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-27-2016
    Location
    Saudi Arabia
    MS-Off Ver
    2013
    Posts
    3

    Re: Google CSV Contacts, Organizer macro

    Wow, it's like magic show Leith when I run it.
    You are awesome.

    Sorry for my late example attachment, and letting you write the script once more. You really made my day.

    Thanks Thanks Thanks Thanks Thanks very much

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Google CSV Contacts, Organizer macro

    Hello martel_9,

    You're welcome. No need to apologize for the late attachment. Glad I could help.

+ 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. Task organizer for employees
    By cadcraft in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-16-2016, 08:38 AM
  2. excel organizer 2010
    By JeffreyR in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-26-2013, 12:10 PM
  3. Auto date and organizer
    By TlgKill in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-12-2013, 04:01 PM
  4. Lead Organizer
    By Greg_Excel in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-26-2010, 04:51 PM
  5. Not able to select multiple contacts to email from a Shared Contacts
    By champs in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 03-10-2009, 02:08 AM
  6. [SOLVED] Where is the Clip Organizer saved?
    By Bob in forum Excel General
    Replies: 1
    Last Post: 09-27-2005, 06:05 PM

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