- Katılım
- 12 Eylül 2004
- Mesajlar
- 885
- Excel Vers. ve Dili
- Excel 2019 Türkçe (Ev)
Excel 2013 Türkçe (Okul)
Form üzerinde iki combobox ile il ve ilçeleri çekiyorum. ancak formu değştirip başka bir formda işlem yaptıktan sonra ilgili comboboxların bulunduğu forma döndüğümde, comboboxlara son işem yapılan sayfadan veri alıyor.
kodlar!...
Kod:
Private Sub ComboBox2_Change()
ComboBox3.Clear
Sheets("İL_İLÇE").Select
For X = 2 To Cells(65536, "B").End(xlUp).Row
If Cells(X, "A").Value = ComboBox2.Text Then
If WorksheetFunction.CountIf(Range("B1:B" & X), Cells(X, "B")) = 1 Then
ComboBox3.AddItem Cells(X, "B").Value
End If
End If
Next
End Sub
Private Sub ComboBox3_Click()
Dim X, S, DHS
On Error Resume Next
Sheets("İL_İLÇE").Select
S = 0
DHS = WorksheetFunction.CountA(Range("B1:B65536"))
For X = 1 To DHS
If Range("B" & X) Like ComboBox2 Then
End If
Next
If S <> 0 Then
Else
End If
End Sub
Private Sub CommandButton1_Click()
Unload Me
UserForm3.Show
End Sub
Private Sub UserForm_Initialize()
Dim X As Long
For X = 2 To Cells(65536, "A").End(xlUp).Row
If WorksheetFunction.CountIf(Range("A1:A" & X), Cells(X, "A")) = 1 Then
ComboBox2.AddItem Cells(X, "A").Value
End If
Next
End Sub
