30/01/2021, 01:37
berduş
bu da benden olsun @feraz hocam
arama/açılır kutuya ekleme kodu ben modüle yazdım
arama/açılır kutuya ekleme kodu ben modüle yazdım
Function CmbBxDoldur(ArananStn As Range, ByVal AranaMtnX As String, CtlCmb As ComboBox)
Dim FoundCell As Range
Dim LastCell As Range
Dim FirstAddr As String
CtlCmb.Clear
With ArananStn
Set LastCell = .Cells(.Cells.Count)
Set FoundCell = ArananStn.Find(what:=AranaMtnX, after:=LastCell)
End With
If Not FoundCell Is Nothing Then FirstAddr = FoundCell.Address
Do Until FoundCell Is Nothing
CtlCmb.AddItem FoundCell.Offset(0, 1).Value
Set FoundCell = ArananStn.FindNext(after:=FoundCell)
If FoundCell.Address = FirstAddr Then Exit Do
Loop
End Function
Form başlangıç koduPrivate Sub UserForm_Initialize()
sonstr = Sayfa3.Cells(Sayfa3.Rows.Count, "h").End(xlUp).Row
Me.ComboBox1.List = Sayfa3.Range("H2:h" & sonstr).Value
End Sub
Combo1 değiştiğinde koduPrivate Sub ComboBox1_Change()
If Len(Me.ComboBox1.Text & "") < 1 Then Exit Sub
With Sayfa3
Set bul = .Range("H:H").Find(Me.ComboBox1.Value, , xlValues, 1)
If Not bul Is Nothing Then AranaMtn = bul.Offset(0, -1).Value
sonstr = .Cells(.Rows.Count, "D").End(xlUp).Row
CmbBxDoldur .Range("D2
sonstr = .Cells(.Rows.Count, "A").End(xlUp).Row
CmbBxDoldur .Range("A2:A" & sonstr), AranaMtn, Me.ComboBox4
End With
End Sub