+ Reply to Thread
Results 1 to 10 of 10

Extract text

  1. #1
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Extract text

    Hi All - Good afternoon

    I have a worksheet full of data (200,000) rows of which I have attached a small sample.

    Col I (field name Town) contains some values with only two characters, these could be two letters, two numbers or a mixture.

    I am trying to create a macro which removes ALL records (rows) if the value in col I contains only two chars.

    Also, can anyone recommend the best way for me to obtain a unique list of all two chars from col I?

    Cheers Guys
    Attached Files Attached Files
    Last edited by Blake 7; 05-18-2011 at 11:36 AM.
    Blake 7

    If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

    If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.

    http://failblog.org/

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,618

    Re: Extract text

    Here, try this:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by zbor; 05-18-2011 at 09:54 AM.

  3. #3
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Extract text

    Hi Z - will give it a bash now and let you know how it went. thanks for responding. hope all well with you.

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,618

    Re: Extract text

    Never better

  5. #5
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Extract text

    never better!! lol wish i could say the same!! am pleased for you!

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,618

    Re: Extract text

    Hmm, yes... maybe I should better say:

    I'm medium... Worse than yesterday, better than tomorrow

  7. #7
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Extract text

    To get the unique list, I'd copy the entire column I somewhere, then (in 2007) delete duplicates, then in next column (let's say your unique list is in M), =LEN(M2)=2 and filter on false and delete those.

    This is the macro I came up with to delete those rows
    Please Login or Register  to view this content.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  8. #8
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Extract text

    hi chem - hows it going. sorry for the delay in responding...i am currently running your code. There are in fact 375,656 records so its taking some time, 5 mins have passed already and screen still flashing!!!

    will get back to you, cheers dude

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Extract text

    Oops, probably should have put
    Please Login or Register  to view this content.
    into that code. That would speed things up and get rid of the flashing.

  10. #10
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Extract text

    lol thanks Chem.

    Thank you to both of you. both codes worked.

    Cheers guys

+ 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