+ Reply to Thread
Results 1 to 5 of 5

How to delete from a list?

  1. #1
    Registered User
    Join Date
    04-08-2009
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    85

    How to delete from a list?

    Does anyone have any vba code which can take a list such
    as this:

    AAC
    AAD
    AAE
    AAOO
    AAR
    AAZPB
    ABC
    ABP

    and delete any code with more than three letters please?
    Thanks in advance.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to delete from a list?

    Have you considered applying an Auto Filter: Text: Contains: ???? and delete results accordingly ( we assume <> ??? is not viable as you state >3 rather than <>3)

    For info. re: deleting rows see Colin Legg's extensive tutorial on efficient methods.
    The above would also give you the syntax nec. to put into place the above suggestion.

  3. #3
    Registered User
    Join Date
    04-08-2009
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    85

    Re: How to delete from a list?

    Thanks for that, but I don't seem to have the Text: Contains feature (using Excel 2003). Is that Excel 2007 you're using?

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: How to delete from a list?

    Hi jp001

    How about creating a helping column say in B. In it put "=Len(A1)" and copy the formula down. Then sort by this column and delete all row(?) that are greater than 3.

    I couldn't tell if you want to delet the entire row of strings with more than 3 letters or only the cells themselves. If you want to delete the cells, do you want to shift up/down?
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to delete from a list?

    Quote Originally Posted by jp001 View Post
    Thanks for that, but I don't seem to have the Text: Contains feature (using Excel 2003). Is that Excel 2007 you're using?
    Profile states 2007 - hence confusion.

    Using 2003 the option remains -> Filter -> Custom -> Contains -> ????

    As I said though refer to the link detailed previously for efficient methods.
    (there are many ways of doing this type of thing - some are significantly more efficient than others - esp. when dealing with large volumes of data)

+ 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