+ Reply to Thread
Results 1 to 2 of 2

Deleting records with Userform listbox selection(s)

  1. #1
    Registered User
    Join Date
    12-27-2015
    Location
    Iowa, USA
    MS-Off Ver
    2010
    Posts
    83

    Deleting records with Userform listbox selection(s)

    Hello,
    I'm not sure if this is the best way to go about this, but I have a userform where one or more values can be selected from cascading list boxe(s). Currently my code looks something like this...

    HTML Code: 
    Simple code and it works....almost. It certainly finds the first matching criteria and deletes the records and shifts the table contents up leaving no blanks. However, it doesn't seem to find all the matching records to delete. In this table and prior to the possibility of deleting a record, I'm resorting to bring the like categories together. While I'm not sure exactly why it's not finding all the matching records, my assumption is when I delete a row the first time it matches criteria, it is interfering with the For Each methodology. It doesn't seem to be finding the next matching. Nevertheless, this seems like a very common and basic function of userforms and applications. Can someone help me get on the right track with my current code example, or illustrate a better way? I would certainly appreciate it.

    Lewis

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,411

    Re: Deleting records with Userform listbox selection(s)

    lot easier to demonstrate with actual workbook.

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

+ 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. Get Multi Selection Listbox userform and clear all selection
    By jp16 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-30-2018, 10:43 AM
  2. [SOLVED] Create multiple records from a multiselect listbox in a userform
    By notitia in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-11-2016, 10:19 PM
  3. [SOLVED] Deleting a line from listbox from userform
    By asmita.nda in forum Excel Programming / VBA / Macros
    Replies: 33
    Last Post: 08-15-2016, 12:00 AM
  4. Populate UserForm Listbox with related records
    By dubcap01 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2015, 02:12 AM
  5. Userform ListBox depending on a previous Listbox selection
    By Figolu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-23-2015, 04:31 PM
  6. Userform ListBox depending on a previous Listbox selection
    By Figolu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-23-2015, 02:08 PM
  7. deleting cell based off selection in listbox VBA
    By happyexcelperson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-27-2013, 09:46 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