Consulting

Results 1 to 12 of 12

Thread: Solved: Edit in ListBox & changes made to RowSource

  1. #1
    VBAX Regular
    Joined
    May 2007
    Posts
    81
    Location

    Solved: Edit in ListBox & changes made to RowSource

    Gurus

    I have a ListBox, its rowsource is a defined range on worksheet 'n'.

    I would like to be able to use the ListBox_DblClick() to amend information and have the change occur in the defined range as well.....

    Is this possible
    Kindest Regards,
    Mike

    I love to Excel

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    yes, you just change the sheet data if it is bound, the listbox will reflect the changed.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    May 2007
    Posts
    81
    Location
    Mr.X

    I want to be able to change the sheet data from the listbox using the DblClick() event....
    Kindest Regards,
    Mike

    I love to Excel

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    That's what I said.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Regular
    Joined
    May 2007
    Posts
    81
    Location
    Sorry Mr.X, but I don't think I'm explaining myself well enough

    When the listbox displays the sheet data, I want to be able to double click a listbox item and enter the listbox to make changes, not the sheet data

    I hope I'm not frustrating you too much
    Kindest Regards,
    Mike

    I love to Excel

  6. #6
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    If you have a unique value (I usually use the rowno), you can use this to look for that value in your sheet and alter the info which you have put in a variable (using an inputbox or form) when doubleclicking the listbox .

  7. #7
    VBAX Regular
    Joined
    May 2007
    Posts
    81
    Location
    Charlize,

    Thanks for your input

    Is an example possible
    Kindest Regards,
    Mike

    I love to Excel

  8. #8
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    If you would post a workbook sample, I could (and probably will) take a look at it and build it in for you. Don't know how your data is setup. So to avoid layout problems, it's best to give a sample.

  9. #9
    VBAX Regular
    Joined
    May 2007
    Posts
    81
    Location
    Charlize,

    I've tried to attach a sample for you, however, this PC is having a "Security" issue:

    Access Denied The requested document, http://vbaexpress.com/forum/newattachment.php, will not be shown.

    Reason: DDR Request score = 13.

    The idea is to keep the actual datasheet very hidden and make changes through the listbox
    Kindest Regards,
    Mike

    I love to Excel

  10. #10
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    What you have to do is call another userform that populates textboxes with the selection from your listbox...edit in the new userform and with a command button tell it to edit the changes on the worksheet which will be reflected in your listbox info..

    see attached example....it is an address book but it has a good example of what your trying to do. When the form loads make a selection in the listbox and then hit edit selection....that opens a new userform4 which populates the textboxes(which you can edit) with data from the selection in the listbox...etc...the command button on userform4 changes that data on the sheet and the listbox will reflect the changes.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  11. #11
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    I'm sure you could use a double click event to open the userform4 for edit...
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  12. #12
    VBAX Regular
    Joined
    May 2007
    Posts
    81
    Location
    Just what I needed.....and more


    The assistance on this site is just brilliant


    I'm going to have to donate now....thanks again
    Kindest Regards,
    Mike

    I love to Excel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •