+ Reply to Thread
Results 1 to 11 of 11

Manipulating range from Userform's listbox?

  1. #1
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Manipulating range from Userform's listbox?

    Hi. My listbox contains 3 columns. I know that it is possible to delete a row from the listbox (link), but this time I need to correct data (not to delete). Can it be done entirely from the userform?
    Please * if you like the answer

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,349

    Re: Manipulating range from Userform's listbox?

    Sure - you cannot edit the values directly on the listbox, but you can add, say, three textboxes for value entry, one for each column:

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Re: Manipulating range from Userform's listbox?

    Thanks Bernie. Here is my code, where to put your code? I've added the textboxes and a button (#2) but the values in the range do not change.
    Please Login or Register  to view this content.
    Last edited by GIS2013; 06-23-2014 at 11:10 AM.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Manipulating range from Userform's listbox?

    Isn't that code for adding data to the worksheet from the listbox?
    If posting code please use code tags, see here.

  5. #5
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Re: Manipulating range from Userform's listbox?

    @Norie,
    Yes, the process goes like that:
    1. Adding data to the worksheet from Combobox and Textbox.
    2. Displaying this data in listbox1 (at least part of it, if it's too long)
    1+2 are done with my original code.
    3. Picking a row from listbox1 (by the mouse) and then changing data in the worksheet.
    Why I need 3? because sometime the values which were filled in were incorrect..
    Thanks

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Manipulating range from Userform's listbox?

    The code Bernie posted would go in a separate sub, eg EditMeal, and could be run via the click event of a command button.

  7. #7
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Re: Manipulating range from Userform's listbox?

    I added 2 new textboxes (2&3) and a new button. It doesn't work, but without any error. Maybe it has to do with the?
    .RowSource
    Did I need to change any property that related to listbox1?

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Manipulating range from Userform's listbox?

    How are you populating your listbox?

    Can you upload an example workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

  9. #9
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Re: Manipulating range from Userform's listbox?

    Please see attached file. I've added one row. Now suppose I need to correct this line. Below
    you can see textbox 2&3 and correct is the new button.
    Attached Files Attached Files

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Manipulating range from Userform's listbox?

    Have a look at the attached file.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Re: Manipulating range from Userform's listbox?

    Wow amazing many thanks

+ 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. [SOLVED] Manipulating range from listbox
    By GIS2013 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-16-2014, 12:01 PM
  2. I Filter range A9:AG300 using listbox(userform) hide all from range blank cells
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2014, 03:28 AM
  3. [SOLVED] Userform ListBox within range to add addition row within a range restriction
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-28-2014, 02:15 PM
  4. [SOLVED] Used named range in listbox on userform
    By WilliamWu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2013, 08:04 AM
  5. 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

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