Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update multiple rows from listbox
I have a listbox containing 20 rows. Some of them have the same values.
The form containing the listbox also contains a textbox where the user is able to change a value in the listbox. I want to change this functionality so that all rows with the same values are updated instead of a single one. This is the current code: Dim lngRowNumber As Long lngRowNumber = lstObj.ListIndex 'Add 14 to the row number as we start at row 14 Range("B" & (lngRowNumber + 14)).Value = txtChange.Text Can someone please help me? Regards, S |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update multiple rows from listbox
Dim lngRowNumber As Long
lngRowNumber = lstObj.ListIndex 'Add 14 to the row number as we start at row 14 oldValue = Range("B" & (lngRowNumber + 14)).Value for i = 13 to lstObject.Listcount - 1 if cells(i,"B") = oldValue then cells(i,"B").Value = txtChange.Text end if Next i -- Regards, Tom Ogilvy " wrote: I have a listbox containing 20 rows. Some of them have the same values. The form containing the listbox also contains a textbox where the user is able to change a value in the listbox. I want to change this functionality so that all rows with the same values are updated instead of a single one. This is the current code: Dim lngRowNumber As Long lngRowNumber = lstObj.ListIndex 'Add 14 to the row number as we start at row 14 Range("B" & (lngRowNumber + 14)).Value = txtChange.Text Can someone please help me? Regards, S |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
insert rows and update linked cells in multiple workbooks | Excel Discussion (Misc queries) | |||
Listbox not refreshing on update | Excel Programming | |||
UserForm Listbox doesn't update | Excel Programming | |||
multiple columns / rows to be referenced through a listbox | Excel Discussion (Misc queries) | |||
Selecting multiple rows from listbox for reporting | Excel Programming |