+ Reply to Thread
Results 1 to 8 of 8

[SOLVED] userform dynamic listbox to add & modify data

  1. #1
    Forum Contributor
    Join Date
    04-05-2013
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    360

    [SOLVED] userform dynamic listbox to add & modify data

    in the attached example i have a userform/listbox that will pull up data from a table. i'm having the following issues:


    1. when you click on an item in the listbox. it populates the MONTH YEAR & AMOUNT text boxes for that specific line item. I'd like to then be able to change the amount and update that line item. right now the code is replacing the first instance of the specific job number. so in the attached example job 08-1000 has 2 billing entries Dec. & Jan.....when you try to modify the January line item it doesn't work.

    2. the combo box MONTH has a row source of MonthList. It seems like the listbox on the sample is getting the month DECEMBER from column B (based on the date entry?)...instead of pulling up the month from column I....Also the month comes in in all CAPS (UCase) not like column I is (should be December not DECEMBER). If possible i'd need to have it pull the month from Column I because potentially the "date" could be different than the month the bill was entered.

    let me know if this makes sense. or if I need to clarify this more. Thanks for the help!
    Attached Files Attached Files
    Last edited by adamheon; 01-19-2017 at 10:54 PM.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: userform dynamic listbox to add & modify data

    Hi adamheon

    This is rather a simple Fix to what you requested in your Original Thread...I'll look at it tomorrow. Bye the bye...the Toggle Buttons are FUBAR...in my opinion, the Toggle Button Code(s) need to be rewritten.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: userform dynamic listbox to add & modify data

    On your Main Userform

    Rename

    Please Login or Register  to view this content.
    To

    Please Login or Register  to view this content.

    The code will then run when you change the combobox, your command button is then redundant.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: userform dynamic listbox to add & modify data

    Hi adamheon

    Try the Code in the attached. I've also modified the Toggle Button Code.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    04-05-2013
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    360

    Re: userform dynamic listbox to add & modify data

    Hi Jaslake, the example works perfect. When i put this into my sheet i'm getting a compile error for .myRow here:

    Please Login or Register  to view this content.
    not sure what that means.

    Also what would be the code to refresh the list box within the userform (lbbilledtodate) when you click update? So that you see the change that was made.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: userform dynamic listbox to add & modify data

    Hi adamheon

    If the example works perfect then there's something different about your sheet...can't trouble shoot without seeing the Offending File.
    the example works perfect. When i put this into my sheet i'm getting a compile error for .myRow here
    I don't know what you're looking for here...please explain...or show an example...
    Also what would be the code to refresh the list box within the userform (lbbilledtodate) when you click update? So that you see the change that was made.

  7. #7
    Forum Contributor
    Join Date
    04-05-2013
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    360

    Re: userform dynamic listbox to add & modify data

    Got everything working. the 1st question was operator error on my part.

    2nd question i solved by changing the updatebilling code to this: now the listbox updates with the new value entered.

    Please Login or Register  to view this content.
    Thanks again for your help on this! I think i will have a follow up to this but i will make a new post.

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: userform dynamic listbox to add & modify data

    You're welcome...glad I could help. Thanks for the Rep.

+ 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. Transfer Data From One Userform Listbox to Another Userform Listbox with 11 columns
    By sparkoft in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-18-2013, 10:54 AM
  2. Populating Userform Listbox with Dynamic Range
    By VBAerthang in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-11-2013, 05:13 AM
  3. Listbox to Listbox, no duplicates & submitting same UserForm data for each Listbox entry.
    By jamieswift1977 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2012, 12:18 PM
  4. How to insert a dynamic range in a UserForm into a ListBox
    By stojko89 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-18-2011, 03:28 AM
  5. Dynamic chart selection from userform listbox
    By kmsoni in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-04-2011, 03:22 PM
  6. Display a UserForm based on Data selected in another UserForm's ListBox
    By RPhilbin83 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-26-2011, 11:35 AM
  7. [SOLVED] Initialize Userform, Populate Listbox, Dynamic RowSource?
    By RShow in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-21-2005, 03: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