Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
insert rows and update linked cells in multiple workbooks [email protected] Excel Discussion (Misc queries) 1 April 2nd 07 10:37 PM
Listbox not refreshing on update tdw Excel Programming 2 July 6th 06 05:06 PM
UserForm Listbox doesn't update befar Excel Programming 1 May 23rd 06 01:05 AM
multiple columns / rows to be referenced through a listbox Hru48 Excel Discussion (Misc queries) 0 July 4th 05 04:12 PM
Selecting multiple rows from listbox for reporting Brett9[_2_] Excel Programming 3 November 5th 03 11:07 AM


All times are GMT +1. The time now is 03:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"