jmcconnell
New Member
- Joined
- Feb 2, 2019
- Messages
- 35
I've got a userform with 2 listboxes and some text boxes.
The user selects an item from the first listbox which then populates choices in a second listbox:
So for example, a user selects Dyffryn Brodyn which would be in listbox 1. Listbox 2 would then show 9,6,10 & 5. If the user then selects number 10 from this listbox then I want somehow select that row to be able add data to the corresponding cell in column C using a textbox on the form. I have the listboxes populating ok.
This is what I have so far:
How do I then use this to be able to add to the specific row (determined by the 2 listbox choices)?
Thank you for your help!
The user selects an item from the first listbox which then populates choices in a second listbox:
So for example, a user selects Dyffryn Brodyn which would be in listbox 1. Listbox 2 would then show 9,6,10 & 5. If the user then selects number 10 from this listbox then I want somehow select that row to be able add data to the corresponding cell in column C using a textbox on the form. I have the listboxes populating ok.
This is what I have so far:
VBA Code:
Private Sub Submit_Click()
Dim RTSWind As Workbook
Dim RTSTracker As Worksheet
Dim matchFormula As String, Lb1 As String, Lb2 As String
Set RTSWind = Workbooks.Open("Path to workbook goes here /RTS testing.xlsm")
Set RTSTracker = RTSWind.Sheets("RTS Tracker")
Lb1 = OpenSites.Text
Lb2 = OpenTurbines.Text
matchFormula = "match(" & Chr(34) & Lb1 & Lb2 & Chr(34) & ",A:A&B:B,0)"
End Sub
How do I then use this to be able to add to the specific row (determined by the 2 listbox choices)?
Thank you for your help!