I have populated data on a listbox reading in from current excel and also theirs a delete function in place. I was wondering if its possible, in regards to the listbox when you double click a value on the listbox, it will let you input all the corresponding data it comes with on your userform.
Private Sub UserForm_Initialize()
For i = 2 To ActiveSheet.Cells(Rows.Count, 3).End(xlUp).Row
If Range("C" & i).Value = frmCourseBooking.txt_Request Then
list_display.AddItem Range("D" & i).Value & ", " & Range("E" & i).Value & ", " & Range("F" & i).Value
list_display.List(list_display.ListCount - 1, 1) = i '''''' added
End If
Next i
End Sub
Private Sub cmdDelete_Click()
If list_display.ListIndex >= 0 Then
ActiveSheet.Cells(list_display.List(list_display.ListIndex, 1), 1).EntireRow.Delete ''''''''' added
list_display.RemoveItem list_display.ListIndex
End If
End Sub
code used for populating
Looking at attached file. Run userform
In regular users put in "U403114" then click active requests, it will run the listbox with all the corresponding information
On double clicking that information I want it to write out to the userform in the corresponding boxes
then whatever's it has read in, if i edit one, override the one its reading in
Any help appreciated
The attached file, when you run it, put user id U403114 in the active requests option it populates that data, but what I want after that, whatever data I click on for it to read that data in then override it's current values .
Bookmarks