crender2000
06-21-2012, 11:57 AM
What I am trying to do is fill the combobox depending on what the user types in the textbox. For example it the user types dog the combobox will be filled with two. Then the user would write the entire userform entries to another sheet. I will include a sample workbook when I can figure out how to add attachment. This is just a simple sample. I need it to work if the sheet is updating and the sheet size for the vlookup changes. Like using .xldown for the range.
Ok here is the error message I get. I am fairly new to VBA I do have a little programming knowledge.
"Could not set the property value. Type mismatch
Finally, once someone figures this out can they show me an example of the lookup value in say D column and the value to be displayed say in the g column.
Private Sub CommandButton1_Click()
Dim LastRow As Object
Set LastRow = Sheet2.Range("a65536").End(xlUp)
LastRow.Offset(1, 0).Value = TextBox1.Text
MsgBox "One record written to Sheet3"
MsgBox "Do you want to enter another record?", vbYesNo
If vbYes Then
TextBox1.Text = ""
TextBox1.SetFocus
Else
Unload Me
End If
End Sub
Private Sub TextBox1_Change()
ComboBox1.Value = Application.VLookup(Me.TextBox1, Sheets("Sheet1").Range("A:C"), 2, False)
Ok here is the error message I get. I am fairly new to VBA I do have a little programming knowledge.
"Could not set the property value. Type mismatch
Finally, once someone figures this out can they show me an example of the lookup value in say D column and the value to be displayed say in the g column.
Private Sub CommandButton1_Click()
Dim LastRow As Object
Set LastRow = Sheet2.Range("a65536").End(xlUp)
LastRow.Offset(1, 0).Value = TextBox1.Text
MsgBox "One record written to Sheet3"
MsgBox "Do you want to enter another record?", vbYesNo
If vbYes Then
TextBox1.Text = ""
TextBox1.SetFocus
Else
Unload Me
End If
End Sub
Private Sub TextBox1_Change()
ComboBox1.Value = Application.VLookup(Me.TextBox1, Sheets("Sheet1").Range("A:C"), 2, False)