02/03/2021, 23:36
feraz
Abey alttaki gibide hata verirse pes artıkyani
Sub IlceAktar()
Dim x As Integer, cboSehir As MSForms.ComboBox, i As Integer, sonn As Integer
Static sayac As Integer
sayac = sayac + 1
Set cboSehir = Me.ComboBox_Sehir
If cboSehir = "" Then GoTo son
With Sheets("TANIMLAR")
sonn = .Range("A1000").End(xlUp).Row
If sayac > 1 Then GoTo son
Me.ComboBox_Ilce.Clear
For x = 2 To sonn
If CLng(.Range("A" & x).Value) = CLng(cboSehir.Value) Then _
Me.ComboBox_Ilce.AddItem (.Range("D" & x).Value)
Next
For i = 2 To sonn
If CLng(.Cells(i, 2).Value) = CLng(cboSehir.Value) Then
cboSehir.Value = .Cells(i, 3).Value
Exit For
End If
Next
End With
son:
sayac = 0
Set cboSehir = Nothing
End Sub