+ Reply to Thread
Results 1 to 10 of 10

duplicate lines

  1. #1
    Registered User
    Join Date
    01-01-2008
    Posts
    5

    duplicate lines

    hello all,
    i was wondering, i have a list of about 2,000 rows of text going down vertically,
    but out of that 2,000 there's only about 1,500 actual items - the rest are duplicates.
    how would i go about eliminating the duplicate strings of text quickly?
    thanks much

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Filter the unquie items to a new column and then delete the old list

    http://www.contextures.com/xladvfilter01.html#FilterUR

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    01-01-2008
    Posts
    5
    thanks, that did the trick!
    one more thing, sorry
    any way to add a prefix/suffix to every item in a list?
    i.e. for html formatting?

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try concatenate (see excel help) or something like

    =A1&".htm"
    VBA Noob

  5. #5
    Registered User
    Join Date
    01-01-2008
    Posts
    5
    ahh sorry, i think i said that wrong...
    here's what i have:
    i got a list of about 1,000 numbers, all vertically down
    how would i go about adding "<option>" before every number and "</option>" after every number?
    thanks again!

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Can you give us an example of data and expected result

    VBA Noob

  7. #7
    Registered User
    Join Date
    01-01-2008
    Posts
    5
    what i have looks like:

    5,366.43
    7,384.87
    9,114.63
    11,614.75
    5,367.38

    what i'm trying to get to is:

    <option>5,366.43</option>
    <option>7,384.87</option>
    <option>9,114.63</option>
    <option>11,614.75</option>
    <option>5,367.38</option>

    rather then doing that manually a few thousand times, is there any way to automate that?
    thnaks

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Either with a helper column. Say numbers in Col A then enter this in B1 and drag down

    ="<option>"&A1&"</option>"
    Then Copy and paste special values.

    or with code. Press Alt + F11 > Insert > Module and paste in the below and close VBA editor. Then select the column or range then press Alt + F8 and run AddText

    Please Login or Register  to view this content.
    VBA Noob

  9. #9
    Registered User
    Join Date
    01-01-2008
    Posts
    5
    thanks, that worked great!

  10. #10
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Your welcome

    VBA Noob

+ 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