+ Reply to Thread
Results 1 to 8 of 8

Select Table entry from list and delete?

  1. #1
    Registered User
    Join Date
    03-05-2020
    Location
    Stoke on Trent, England
    MS-Off Ver
    Excel 2016
    Posts
    59

    Select Table entry from list and delete?

    Hello All,

    I am looking to add a button to my sheet which will deleted a table entry based on what is selected in a drop down list which contains the names of the items in the table.

    Yesterday I added a button which deletes the last entry from the table without deleting the entire row. This must remain the case as content is in the row outside of the table

    When the entry is deleted id need the data below to move up so not to create any blank table lines also.

    Any ideas how to do this?
    Attached Files Attached Files

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Select Table entry from list and delete?

    Which table column is the drop down to select from?

    Have you added a dropdown anywhere yet or does this need to pop up when you click a new delete entry button?

    BSB

  3. #3
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Select Table entry from list and delete?

    Ignore the above, I've now seen where you added the drop down list.

    Leave it with me.

    BSB

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Select Table entry from list and delete?

    In the attached version I have added a new button that fires the below code.
    As long as a valid entry is recorded in the drop down box (S8) it will delete the correspoinding table row.

    You may wish to add an "Are you sure?" message as with the other delete button.

    Please Login or Register  to view this content.
    BSB
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-05-2020
    Location
    Stoke on Trent, England
    MS-Off Ver
    Excel 2016
    Posts
    59

    Re: Select Table entry from list and delete?

    Many thanks.

    I have loaded twice now and get the same result.

    It works fine and I can select and it will delete perfectly but on deleting the button then dies and wont do anything else when another options is selected? The button also seems to change location slightly. Any ideas?

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Select Table entry from list and delete?

    It's not actually the button moving but your drop down list. When you delete a row from a table it leaves everything to the sides as it was but will shift anything below the table up.

    Try the attached version. It uses a simple UserForm for the drop down list rather than an in cell one.

    Any good to you?

    BSB
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-05-2020
    Location
    Stoke on Trent, England
    MS-Off Ver
    Excel 2016
    Posts
    59

    Re: Select Table entry from list and delete?

    I like that, not used forms before at all but seems to be a sweet solution thanks.

  8. #8
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Select Table entry from list and delete?

    They can be very useful and with a little practice, very simple to build.

    BSB

+ 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. Delete an entry (row) in a userform listbox and update table on worksheet
    By colin7 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-08-2019, 07:18 AM
  2. Clear not delete list box entry
    By travelkid in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-15-2019, 06:41 AM
  3. [SOLVED] Select List box entry based on List box on another userform. --> Edit data on next userfor
    By travelkid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-28-2019, 12:46 PM
  4. [SOLVED] create clean list after delete bad entry
    By smatbis in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-25-2016, 06:38 PM
  5. Replies: 3
    Last Post: 09-12-2013, 12:37 AM
  6. Excel Table Delete Duplicates Leaving Most Recent Entry
    By BuntyMac in forum Excel General
    Replies: 0
    Last Post: 03-02-2011, 11:10 AM
  7. Can a user select more than one entry in a drop down list?
    By Brendan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-05-2006, 11:45 PM

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