ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Editing items in a ListBox (https://www.excelbanter.com/excel-programming/427731-editing-items-listbox.html)

Ed Sowell

Editing items in a ListBox
 
I have a worksheet with data that I want to allow the user to edit but only
through User form. To this end, I load the worksheet into a ListBox on a
Userform that also has a Combo box ro Text box for each of the columns in
the ListBox. the idea is to allow the user to select a row in the ListBox,
move the data into the various combo or text boxes, allow editing of one or
more such boxes, then write back into the selected row in the List box.
After doing this on one or more rows, an OK button will write back into the
worksheet.

What's hanging me up right now is it won't let me write back into the
ListBox. Is this a fundamental problem, or is there a Property of the
ListBox that would allow it?

If I can't do it, what is the work-around? I suppose I could just save the
changed rows in a separate table for later writing into the Worksheet, but
that would eliminate the visual feedback of seeing the data change in the
table.

Any ideas?

TIA

Ed


Ed Sowell

Editing items in a ListBox
 
I figured it out. I load the data from the worksheet into a 2-d table of
strings, then simply assign it to the ListBox.List.
After editing the data in the ListBox (programmatically), I write the
ListBox back into the worksheet cell-by-cell.

Works great

Ed
"Ed Sowell" wrote in message
...
I have a worksheet with data that I want to allow the user to edit but only
through User form. To this end, I load the worksheet into a ListBox on a
Userform that also has a Combo box ro Text box for each of the columns in
the ListBox. the idea is to allow the user to select a row in the ListBox,
move the data into the various combo or text boxes, allow editing of one or
more such boxes, then write back into the selected row in the List box.
After doing this on one or more rows, an OK button will write back into the
worksheet.

What's hanging me up right now is it won't let me write back into the
ListBox. Is this a fundamental problem, or is there a Property of the
ListBox that would allow it?

If I can't do it, what is the work-around? I suppose I could just save the
changed rows in a separate table for later writing into the Worksheet, but
that would eliminate the visual feedback of seeing the data change in the
table.

Any ideas?

TIA

Ed




All times are GMT +1. The time now is 06:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com