+ Reply to Thread
Results 1 to 2 of 2

Best way to remove items from list

  1. #1
    Forum Contributor
    Join Date
    05-26-2004
    Location
    Halifax, UK
    MS-Off Ver
    Office 2016
    Posts
    260

    Best way to remove items from list

    Suppose I have a list of names starting cell A1 and listed downwards, e.g. "Sam" in A1, "Sally" in A2 etc. If I want to delete an entry from this list, what is the best way to then 'move up' the entries below the deleted one so that there is no gap in the list? I know I could use Delete Row but if there are lots of names and lots of entries being deleted (say by a VBA routine) won't this be slow?

    Same with inputting a new entry...I could locate the correct row (say the names are alphabetical) so is the best way to insert the new name to first insert a new row?

    In both cases I don't want to sort lists, I want the order to stay the same except for adding/deleting an entry.

    Thanks
    -Rob

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Best way to remove items from list

    The faster is to read the complete range and put it in an array, modify the array and paste it back in the range with the appropriate size
    - Battle without fear gives no glory - Just try

+ 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. Replies: 1
    Last Post: 09-14-2013, 04:55 AM
  2. Replies: 2
    Last Post: 08-23-2011, 08:55 PM
  3. Remove matching items from a workbook based on a master list
    By Apel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-16-2009, 08:20 PM
  4. cleaning up my list - remove items in the list
    By tmssj2000 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-06-2009, 02:00 AM
  5. remove items from list box (sorry it`s a bit long)
    By bahadirakcan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-10-2006, 08:11 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