OldManDemosthenes
New Member
- Joined
- Apr 19, 2011
- Messages
- 38
I have created a userform with a multiselect listbox which is populated from sheet("Names"). When selected, and the "Run" button on the userform is clicked, the selections are placed in column D of sheet("Input"). (Code is below)
What I would like to do is add an offset formula (or whatever you think might work better) which will draw data from sheet("Data") about each selection and place it next to the selection on the Input sheet.
Specifically, if "name3" is selected in the listbox, the formula will find "name3" in column A of the Data sheet and find the value from the same row, column C of that sheet. It would then place that value found in row E of the Input sheet next to the "name3" value which is in column D. The formula would repeat this process for each of the listbox selections.
Thanks in advance
What I would like to do is add an offset formula (or whatever you think might work better) which will draw data from sheet("Data") about each selection and place it next to the selection on the Input sheet.
Specifically, if "name3" is selected in the listbox, the formula will find "name3" in column A of the Data sheet and find the value from the same row, column C of that sheet. It would then place that value found in row E of the Input sheet next to the "name3" value which is in column D. The formula would repeat this process for each of the listbox selections.
Thanks in advance
Private Sub cbRun_Click()
Dim i As LongRange("D:E").ClearContentsWith lbNameFor i = 0 To .ListCount - 1If .Selected(i) ThenCells(Rows.Count, "D").End(xlUp)(2) = .List(i)End IfNext iEnd WithUnload Me
End Sub