*Why Does The Combo Box Revert To The Earliest Record only ?* I have created a user form database with combo box linked with Range A:A which is Company name followed by address data And i have multiple address for same company name.So when i search company name the combo box reverts only to the earliest address.Below is the screenshot link with VBA script
<https://lh3.googleusercontent.com/-VbJTKr2icTo/V3PHmPU8VnI/AAAAAAAAA5A/zb_2YWIJ0dkFcwjJiBJjCa3uXiSVgUVPgCLcB/s1600/123.png> <https://lh3.googleusercontent.com/-HJoySCiM8iQ/V3PHp0EbAXI/AAAAAAAAA5I/f8XIfe1jUHksmm5wyOtQcXts4nD-ucGMwCLcB/s1600/1234.png> Private Sub cmdSearch_E_Click() blnNew = False txtfirmnames.Text = "" txtAdd1_E.Text = "" txtAdd2_E.Text = "" txtAdd3_E.Text = "" txtAdd4_E.Text = "" txtcity_E.Text = "" txtpostal_E.Text = "" Txtaddresscountry_E.Text = "" TRows = Worksheets("Data_Entity").Range("A1").CurrentRegion.Rows.Count For i = 2 To TRows If Trim(Worksheets("Data_Entity").Cells(i, 1).Value) = Trim(ComboBox2.Text) Then txtfirmnames.Text = Worksheets("Data_Entity").Cells(i, 1).Value txtAdd1_E.Text = Worksheets("Data_Entity").Cells(i, 2).Value txtAdd2_E.Text = Worksheets("Data_Entity").Cells(i, 3).Value txtAdd3_E.Text = Worksheets("Data_Entity").Cells(i, 4).Value txtAdd4_E.Text = Worksheets("Data_Entity").Cells(i, 5).Value txtcity_E.Text = Worksheets("Data_Entity").Cells(i, 6).Value txtpostal_E.Text = Worksheets("Data_Entity").Cells(i, 7).Value Txtaddresscountry_E.Text = Worksheets("Data_Entity").Cells(i, 8).Value Exit For End If Next i If Trim(txtfirmnames.Text) = "" Then cmdSave_E.Enabled = False cmdDelete_E.Enabled = False Frame6.Enabled = False Else cmdSave_E.Enabled = True cmdDelete_E.Enabled = True Frame6.Enabled = True End If End Sub what i want is to search for next address with same company name when i click SEARCH 2nd time and so on. Kindly assist me with the same. http://stackoverflow.com/q/38078823/5320005 -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at https://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout.