Getting a UserForm to populate a sheet using a row reference in a combobox

neilybig

New Member
Joined
Dec 2, 2018
Messages
9
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.

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
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top