+ Reply to Thread
Results 1 to 6 of 6

find text in listbox on userform, delete row containing that text on spreadsheet

  1. #1
    Registered User
    Join Date
    03-16-2012
    Location
    florida
    MS-Off Ver
    mac 2008
    Posts
    63

    find text in listbox on userform, delete row containing that text on spreadsheet

    Hey all, had a quick question!

    I want to do something along the lines of this:
    Please Login or Register  to view this content.
    But I want it to be on a userform with a listbox. Listbox1 will contain a list from named range, and i want people to be able to click the desired deleted one, press delete, it will go to Sheet5, find that row and delete it. Is this possible?
    Thanks!
    Steve

  2. #2
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Akron, OH
    MS-Off Ver
    15.0
    Posts
    424

    Re: find text in listbox on userform, delete row containing that text on spreadsheet

    Steve,

    Yes.

    Without testing the code, or seeing/understanding the contents of Listbox1, I think the code would look something like this (not much different from what you have).

    Please Login or Register  to view this content.
    I generally like to avoid the attribute: .ActiveSheet unless I'm referencing a newly-created worksheet or the worksheet where a macro button you're pushing because it can make the results dependent upon which sheet is active/you have open when the macro runs. But it looks like .ActiveSheet was used appropriately in your code.
    Last edited by joe31623; 02-05-2016 at 12:09 PM.
    <---If my answer helped, please click *

  3. #3
    Registered User
    Join Date
    03-16-2012
    Location
    florida
    MS-Off Ver
    mac 2008
    Posts
    63

    Re: find text in listbox on userform, delete row containing that text on spreadsheet

    I think what I was hoping to make it do was have a userform open, which would contain listbox 1. that userform would give a list of names from a table, you woudl select from teh listbox the one you wanted to delete and press the delete button. it would then search a specific worksheet for that text (would be in A column) and delete the entire row.

    does that make sense?
    Screen Shot 2016-02-05 at 8.31.36 PM.png

  4. #4
    Registered User
    Join Date
    03-16-2012
    Location
    florida
    MS-Off Ver
    mac 2008
    Posts
    63

    Re: find text in listbox on userform, delete row containing that text on spreadsheet

    hi anyone have an idea how to make this work within a userform like this?

  5. #5
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Akron, OH
    MS-Off Ver
    15.0
    Posts
    424

    Re: find text in listbox on userform, delete row containing that text on spreadsheet

    I'm not too familiar with Userforms, but if you give me a cell, range of cells, or a starting cell and continuous column/row of cells, I can do pretty much anything along the lines of what you're asking about.

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: find text in listbox on userform, delete row containing that text on spreadsheet

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    See attached
    Attached Files Attached Files

+ 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. Userform / Spreadsheet Text Wrap
    By BigPaulMc in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-22-2015, 08:07 PM
  2. [SOLVED] Userform: How do I use text/values from a spreadsheet to customize the userform?
    By bananajelly in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-14-2014, 03:47 PM
  3. Populating userform listbox from sheet cell with multiline text
    By newbi004 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-16-2013, 07:44 AM
  4. Read text file to ListBox and Delete rows in ListBox and re-write text file
    By Nu2Java in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 10-29-2012, 09:42 AM
  5. find text then delete two rows below it including row of found text
    By leanne2011 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-25-2011, 08:05 AM
  6. Find and delete text from a cell with lots of text.
    By leonardzen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-22-2011, 10:52 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