Hi all,
I need your collective brains to solve an issue, I have a userform that pulls some data in from a worksheet, this sheet is variable and is based on the number in a combobox. So Combobox shows 1. The code references this row and pulls some data.
This works fine, but I want to enter some additional data into the userform and add this into the SAME row but different columns that it comes from.
The code I have an issue with is below.
help much appreciated as always
I need your collective brains to solve an issue, I have a userform that pulls some data in from a worksheet, this sheet is variable and is based on the number in a combobox. So Combobox shows 1. The code references this row and pulls some data.
This works fine, but I want to enter some additional data into the userform and add this into the SAME row but different columns that it comes from.
The code I have an issue with is below.
Code:
Private Sub CommandButton1_Click()
Dim dataRow As Long
Dim lbtarget As MSForms.ComboBox
Dim rngSource As Range
[INDENT]'Set reference to the range of data to be filled[/INDENT]
Set rngSource = Worksheets("Trial Tracker").Range("A:A")
[INDENT]'Fill the listbox[/INDENT]
Set lbtarget = Me.ComboBox1
With lbtarget
[INDENT]'So I want the code below to know what row the combobox has pulled from and add more detail into the row, columns 14 and 15. I get object doesn't support property or method'[/INDENT]
.List = rngSource.Cells.Value
dataRow = rngSource.Match(ComboBox1.Value, .Range("A:A"))
.Cells(dataRow, 14).Value = TextBox3.Value
.Cells(dataRow, 15).Value = TextBox4.Value
End With
End Sub
help much appreciated as always