Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have had a lot of help on this project and i need just a bit more PLEASE!
I have a userform that has a listbox with multiple columns in it. I have it set so the user can choose as many rows as they like. The data that fills the listbox comes from a named range ("Database") from a worksheet ("ProduceData"). As the user makes their selections in the listbox(may be 1 or maybe 10 selected) and they press ENTER it needs to find all of the selections in the database that match and places the text "Paid" in column AG. At this time the code I have that was given to me doesn't work, it only puts one "paid" and it doesn't ever correspond to the selections. For example if I choose invoice numbers 1,15,26 &35 it should then find those exact numbers in the database and put "Paid" in the same rows. I hope i have not confused anyone. Sometimes i struggle with "what is enough info", let me know if you need anything else. Thank you in advance. And for those of you who have been helping me with this I promise this is the last thing in the project that has to get done;) Dim sh As Worksheet Set sh = Worksheets("ProduceData") Dim rng As Range Set rng = sh.Range("Database").Columns(1).Cells Dim i As Long Dim rw As Long For i = 0 To lstData.ListCount - 1 If lstData.Selected(i) Then rw = rng(i + 1).Row sh.Cells(rw, "ag").Value = "Paid" End If Next -- Though daily learning, I LOVE EXCEL! Jennifer |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help with UserForm code. | Excel Programming | |||
Help with UserForm Code | Excel Programming | |||
Creating a Userform using code | Excel Programming | |||
Userform Code | Excel Programming | |||
VBA code for Userform | Excel Programming |