Merhaba arkadaşlar aşağıdaki kodla listbox1 de seçim yaptığımda excel sayfa1de Q sütünundaki babası üzerine geldiğinde userform1 de bulunan optionbutton1, Q sütunundaki annesi üzerine geldiğinde Userform1 de bulunan optionbutton2 (annesi) otomatik işaretlemesini istiyorum.
If combo.ListIndex > 0 Then
sat = combo.ListIndex + 1
Else
sat = 1
End If
Dim i As Integer
Dim j As Integer
Dim aranan1 As String
ListBox1.Clear
ListBox1.ColumnCount = 2
ListBox1.ColumnWidths = "0;100;0" 'lisbox'taki sütunların genişliği
sat1 = 0
j = Len(ARABUL.Text)
For i = 2 To Worksheets("sayfa1").[A65536].End(3).Row
aranan1 = UCase(Replace(Replace(LCase(Mid(Sheets("sayfa1").Cells(i, sat).Value, 1, j)), "x", "x"), "x", "x"))
If Worksheets("sayfa1").Cells(i, sat).Value > 0 Then
If ARABUL.Text <> "" Then
'If aranan1 = LCase(ARABUL.Text) Then
If aranan1 = UCase(Replace(Replace(ARABUL.Text, "ı", "I"), "i", "İ")) Then
ListBox1.AddItem
ListBox1.List(sat1, 0) = i
ListBox1.List(sat1, 1) = Sheets("sayfa1").Cells(i, sat).Value
sat1 = sat1 + 1
End If
Else
ListBox1.AddItem
ListBox1.List(sat1, 0) = i
ListBox1.List(sat1, 1) = Sheets("sayfa1").Cells(i, sat).Value
sat1 = sat1 + 1
End If
End If
Next
If combo.ListIndex > 0 Then
sat = combo.ListIndex + 1
Else
sat = 1
End If
Dim i As Integer
Dim j As Integer
Dim aranan1 As String
ListBox1.Clear
ListBox1.ColumnCount = 2
ListBox1.ColumnWidths = "0;100;0" 'lisbox'taki sütunların genişliği
sat1 = 0
j = Len(ARABUL.Text)
For i = 2 To Worksheets("sayfa1").[A65536].End(3).Row
aranan1 = UCase(Replace(Replace(LCase(Mid(Sheets("sayfa1").Cells(i, sat).Value, 1, j)), "x", "x"), "x", "x"))
If Worksheets("sayfa1").Cells(i, sat).Value > 0 Then
If ARABUL.Text <> "" Then
'If aranan1 = LCase(ARABUL.Text) Then
If aranan1 = UCase(Replace(Replace(ARABUL.Text, "ı", "I"), "i", "İ")) Then
ListBox1.AddItem
ListBox1.List(sat1, 0) = i
ListBox1.List(sat1, 1) = Sheets("sayfa1").Cells(i, sat).Value
sat1 = sat1 + 1
End If
Else
ListBox1.AddItem
ListBox1.List(sat1, 0) = i
ListBox1.List(sat1, 1) = Sheets("sayfa1").Cells(i, sat).Value
sat1 = sat1 + 1
End If
End If
Next
