+ Reply to Thread
Results 1 to 5 of 5

Code to delete records in list box from sheet

  1. #1
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    Code to delete records in list box from sheet

    I am using the following code on a userform to populate a list box called SerialNumber:
    Please Login or Register  to view this content.
    It searches for entries in G (from rows 6 down), where the adjacent F column is blank.

    I am looking for a command button code that will delete the rows on the ReturnData sheet from which the data in the list box originates from. (therefore deleting the rows where data is present in G6 on but not in the adjacent F column)

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Code to delete records in list box from sheet

    Try this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    Re: Code to delete records in list box from sheet

    Thank you, that did.
    However I'm trying to add the following to the end of the code but its not working:
    Unload Me
    Unload.NewItemMultiple

    It seems like it dosnt like that last line.
    What am I doing wrong?

    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Code to delete records in list box from sheet

    Remove the period

  5. #5
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    Re: Code to delete records in list box from sheet

    Thank you.

+ 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. Code to delete records displayed in list box.
    By Nitefox in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 12-27-2013, 03:13 PM
  2. Code to delete rows containing names from a list on another sheet
    By eglassburn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-23-2011, 12:52 PM
  3. Filter records, paste into a different sheet, delete rows from original sheet.
    By gloworm1973 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2009, 05:24 AM
  4. delete used records from drop down list?
    By Prashant T in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-04-2006, 05:00 PM
  5. Delete records from 1 list that are in another?
    By astockley2005 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-06-2005, 07:05 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