DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
hocam teşekkürler ama dediklerininzi nasıl yapacağım ekteki örnekte göstere bilirmisiniz..
Private Sub UserForm_Initialize()
Sheets("Sayfa1").Select
UserForm1.ComboBox1.RowSource = "A2:A" & Cells(65536, "A").End(xlUp).Row
If ComboBox1.ListCount > 0 Then ComboBox1.ListIndex = 0
End Sub
Sub ilce_liste()
Dim i As Long, a As Long
ReDim myarr(1 To 1, 1 To 1)
ComboBox2.Clear
For i = 2 To Cells(65536, "B").End(xlUp).Row
If Cells(i, "B").Value = ComboBox1.Value Then
a = a + 1
ReDim Preserve myarr(1 To 1, 1 To a)
myarr(1, a) = Cells(i, "C").Value
End If
Next i
If a > 0 Then
ComboBox2.Column = myarr
ComboBox2.ListIndex = 0
End If
End Sub
Rica ederim.hocam teşekkürler sayenizde bir şey dah öğrenmiş oldum....
Sub ilce_liste()
Dim i As Long, a As Long
ReDim myarr(1 To 1, 1 To 1)
ComboBox2.Clear
For i = 2 To Cells(65536, "B").End(xlUp).Row
If Cells(i, "B").Value = [COLOR="Red"][B]CLng([/B][/COLOR]ComboBox1.Value[B][COLOR="red"]) [/COLOR][/B]Then
a = a + 1
ReDim Preserve myarr(1 To 1, 1 To a)
myarr(1, a) = Cells(i, "C").Value
End If
Next i
If a > 0 Then
ComboBox2.Column = myarr
ComboBox2.ListIndex = 0
End If
End Sub
Sub ilce_liste()
Dim i As Long, a As Long[B][COLOR="Red"], deg As String[/COLOR][/B]
ReDim myarr(1 To 1, 1 To 1)
ComboBox2.Clear
For i = 2 To Cells(65536, "B").End(xlUp).Row
[B][COLOR="Red"]deg = Cells(i, "B").Value[/COLOR][/B]
If [COLOR="red"][B]deg [/B][/COLOR]= ComboBox1.Value Then
a = a + 1
ReDim Preserve myarr(1 To 1, 1 To a)
myarr(1, a) = Cells(i, "C").Value
End If
Next i
If a > 0 Then
ComboBox2.Column = myarr
ComboBox2.ListIndex = 0
End If
End Sub
Rica ederim.hocam sizi yorduğum için tekrar özür dilerim...sorunu herzamanki gibi hallettiniz teşekkürler...
Kaydettiğniz kodun en altına aşğıdaki kodu yazınız.
Kod:call ilce_liste
Sub ilce_liste()
Dim i As Long, a As Long
ReDim myarr(1 To 1, 1 To 1)
ComboBox12.Clear
Set sv = Sheets("veriler")
For i = 2 To sv.Cells(65536, "B").End(xlUp).Row
If sv.Cells(i, "B").Value = ComboBox7.Value Then
a = a + 1
ReDim Preserve myarr(1 To 1, 1 To a)
myarr(1, a) = sv.Cells(i, "C").Value
End If
Next i
If a > 0 Then
ComboBox12.Column = myarr
ComboBox12.ListIndex = 0
Erase myarr
End If
Set sv = Nothing
End Sub