hello my master,I Want You Help to correct Search Code in Userform5 to Search on two conditions ,by Bond Type in ComboBox6 & Bond No. in ComboBox7
Code:
Private Sub ComboBox7_Change()
Dim LR As Long
Dim Mh As Long
Dim iCont As Integer
Dim r As Integer
Dim c As Integer
Dim ii As Double
ii = Me.ComboBox7.Value
'==================================
KH_ClearControl
'==================================
With Sheets("Sheet2")
LR = .Cells(.Rows.Count, "D").End(xlUp).Row + 1
Mh = WorksheetFunction.Match(ii, .Range("D2:D" & LR), 0) + 3
iCont = WorksheetFunction.CountIf(.Range("D2:D" & LR), ii)
End With
Me.TextBox3.Value = Sheets("Sheet2").Cells(Mh, 1).Value
Me.ComboBox1.Value = Sheets("Sheet2").Cells(Mh, 2).Value
Me.ComboBox2.Value = Sheets("Sheet2").Cells(Mh, 5).Value
'==========
For r = 1 To iCont
For c = 1 To 2
Adr = Cells(r, c).Address(0, 0)
Me.Controls(Adr).Value = Sheets("Sheet2").Range("C" & Mh).Cells(r, c).Value
Next
Next
End Sub