RE: Combobox Vba Kodları Oluşturmak - berduş - 30/01/2021
bu da benden olsun @feraz hocam
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ıç kodu
Private 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 kodu
Private 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), AranaMtn, Me.ComboBox3
sonstr = .Cells(.Rows.Count, "A").End(xlUp).Row
CmbBxDoldur .Range("A2:A" & sonstr), AranaMtn, Me.ComboBox4
End With
End Sub
RE: Combobox Vba Kodları Oluşturmak - conquerora - 01/03/2021
Merhaba
Yardımlarınız için teşekkürler.
Güzel bir çalışma oldu.
|