Patriot2879
Well-known Member
- Joined
- Feb 1, 2018
- Messages
- 1,259
- Office Version
- 2010
- Platform
- Windows
Hello good afternoon, hope you can help me please. I have the code below where i have made a module called 'GetDataNow' and linked that with the Combobox1, but i get an error with the code and when i select a name in combobox1, textbox1 does not populate the value from 'Fixer Info' sheet Row D2 to last row. hope you can help please?
VBA Code:
Option Explicit
Dim id As String, i As Long, j As Integer, flag As Boolean
Sub GetDataNow()
Dim Rw As Variant
If Len(UserForm2.ComboBox1.Value) > 0 Then
flag = False
id = UserForm2.ComboBox1.Value
Rw = Application.Match(id, Sheets("Fixer Info").Range("A2:A56"), 0)
If Not IsError(Rw) Then
flag = True
For j = 4
UserForm2.Controls("ComboBox" & j).Value = ThisWorkbook.Worksheets("Fixer Info").Cells(Rw, j).Value
Next j
End If
If flag = False Then
For j = 4
UserForm2.Controls("ComboBox" & j).Value = ""
Next j
End If
Else
End If
End Sub