+ Reply to Thread
Results 1 to 2 of 2

"Delete Selected" in Search Result listbox deletes first row, instead of selected row.

  1. #1
    Registered User
    Join Date
    11-07-2012
    Location
    WA
    MS-Off Ver
    Excel 2007 2010
    Posts
    8

    "Delete Selected" in Search Result listbox deletes first row, instead of selected row.

    Excel 2010
    VBA experience: Very Junior but not quite beginner
    Userform purpose is: Data Entry tool with a search /update /Delete function.
    Supplied example is stripped of private information and beauty :-) to isolate code/functionality issues.
    (please excuse in-code scribblings and deactivated non functional items)

    *search fills listbox1 with matching results
    selecting result should allow user to view data from that row in Userform and either update or delete that row.Stripped_dev.xlsmStripped_dev.xlsm

    Issue: Delete function (after searched and selected from listbox of results) does not delete selected (activecell) row. Rather it always deletes first row of data. I have tried numerous alternative methods to get the selection of the row in the listbox to set C as the activecell similar to the "amend" code, but it just blows up and errors. So I'm leaving it somewhat in it's initial partially functional state. (Note: if you enter the exact query search, as in an exact "abc-002" vs. a * search like " abc* " it will set the correct activecell and delete it. But that kinda defeats the purpose of a search function. )

    Please Login or Register  to view this content.
    The amend/update function successfully amends the selected (activecell) row after selecting the results from a * search. scratching head as to how to get the activecell status similar to the amend/update function to work with the Delete.

    Please Login or Register  to view this content.


    This has been cobbled together using a number of different templates and my own limited vba to get the functionality desired . (I feel obliged to make clear that I am not the Originator of the majority of the cod. So now I'm trying to build off functional models. I made attempts first and don't think I was even close so most of the good stuff isn't mine. Meaning, there are parts of this that I really do not claim to fully understand how exactly it works. I thought I had a clue, but clearly not so much.)

    I do have a list of functionality that I would like to add, but I think the Delete function is fairly key to lock down before trying to add bells and whistles.

    Other things I need to figure out just in case someone has a solution/code/link to offer:

    1.Protect the spreadsheet from direct access (not using Userform) to all but one or two usesr. (force non admins users to use Userform only, but allow admin to easily access sheet directly when needed.. ? Userlevel password protection)

    2. if userlevel passwords is possible, setting up users auto signature. (like a database where a user logs in and all edits by that user are associated with that user (i.e. automatically show "input by xxxx" on "date" ))

    3. additional "Search by Due date" function. (this might be overkill, but the ideal function would be to be able to set a search based on one column "Due Date" and return AND OUTPUT a listing of all rows "due between date A and date B".

    I'm sure there are more, but I don't want to get off target. Before I worry about any of that, I have to get the Delete to work. Else I will need to change my gameplan.

    Thanks in advance.
    Last edited by Faustus; 06-06-2013 at 01:55 PM.

  2. #2
    Registered User
    Join Date
    11-07-2012
    Location
    WA
    MS-Off Ver
    Excel 2007 2010
    Posts
    8

    Re: "Delete Selected" in Search Result listbox deletes first row, instead of selected row.

    Hey all,.. I believe I have found my critical error and I may need to start from scratch. (relatively)
    I will try again,

    I wouldn't waste any extra time on this one as it might need to be done a different way.

    I would still be interested in the other issues, as I will likely want to accomplish them once I get the basic functionality up and running.

    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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