İl ve İlçeleri iki ayrı Comboboxta gösterme

Katılım
18 Mayıs 2008
Mesajlar
65
Excel Vers. ve Dili
microsoft ofis 2003
Saygıdeğer Hocalarım verilen cevaplar doğrultusunda kodları sayfamda kullandım ancak
1 - combobox içinde sürekli ilk il ve ilk ilçesi görünüyor başka yapılanlarda gözükmüyordu
2 - İl combosunu belli bir aralığı göstermesini sağlıyamadım
Gönderdiğim dosya incelenirse ben kaynak sayfamda başka işler için başka bilgilerde bulunduruyorum ( Örneğin cinsiyet için kız-erkek iki hücre bunun için ayrı sayfa açmamak için -Aile bireyleri için 6 hücre ) Bu bilgilerde il combosunun içinde gözüküyorlar ayarını beceremedim. Yardımlarınız için şimdiden teşekkür ederim
 
Son düzenleme:
Katılım
18 Mayıs 2008
Mesajlar
65
Excel Vers. ve Dili
microsoft ofis 2003
Değerli arkadaşlar sorumun 2 cisini aşağıdaki kodun kırmızı olan yerini sildim hallodu ama 1ci sorumu bulamadım. Sildiğim yer neişe yarıyordu bilmiyorum

Private Sub ComboBox1_Change()
Dim sat As Long, son_sut As Integer, adres As Range, hcr As Range
If ComboBox1.ListIndex < 0 Then Exit Sub
sat = ComboBox1.ListIndex + 2
son_sut = Sheets("Data").Cells(sat, 256).End(xlToLeft).Column
Set adres = Sheets("Data").Range(Sheets("Data").Cells(sat, 2), Sheets("Data").Cells(sat, son_sut))
ComboBox2.Clear
For Each hcr In adres
ComboBox2.AddItem hcr
Next
ComboBox2.ListIndex = 0
End Sub

Private Sub ComboBox1_Click()

End Sub

Private Sub CommandButton1_Click()
Unload UserForm1
End Sub

Private Sub UserForm_Click()
End Sub

Private Sub UserForm_Initialize()
ComboBox1.RowSource = "Data!A2:A" Sheets("Data").Cells(65536, "A").End(xlUp).Row
ComboBox1.ListIndex = 0

End Sub
 
Katılım
18 Mayıs 2008
Mesajlar
65
Excel Vers. ve Dili
microsoft ofis 2003
De&#287;erli arkada&#351;lar sorumun 1 ve 2 cisinide a&#351;a&#287;&#305;daki kodun k&#305;rm&#305;z&#305; olan yerini sildim hallodu

Private Sub ComboBox1_Change()
Dim sat As Long, son_sut As Integer, adres As Range, hcr As Range
If ComboBox1.ListIndex < 0 Then Exit Sub
sat = ComboBox1.ListIndex + 2
son_sut = Sheets("Data").Cells(sat, 256).End(xlToLeft).Column
Set adres = Sheets("Data").Range(Sheets("Data").Cells(sat, 2), Sheets("Data").Cells(sat, son_sut))
ComboBox2.Clear
For Each hcr In adres
ComboBox2.AddItem hcr
Next
ComboBox2.ListIndex = 0
End Sub

Private Sub ComboBox1_Click()

End Sub

Private Sub CommandButton1_Click()
Unload UserForm1
End Sub

Private Sub UserForm_Click()
End Sub

Private Sub UserForm_Initialize()
ComboBox1.RowSource = "Data!A2:A" Sheets("Data").Cells(65536, "A").End(xlUp).Row
ComboBox1.ListIndex = 0

End Sub
 
G

gezgin64

Misafir
Bu konuyla ilgili bir iste&#287;im olacak. &#304;ki (2) adet daha ComboBox ekleyebilir miyiz. Ayr&#305;ca her Combobox 10 adet sutuna ait h&#252;creleri i&#231;ersin. Yani her ilin toplam 30 il&#231;esi oldu&#287;unu varsayarsak her comboBox 10 ar adet il&#231;eyi s&#305;ralas&#305;n. yard&#305;mlar&#305;n&#305;z i&#231;in &#351;imdiden te&#351;ekk&#252;rler
 
Son düzenleme:
Üst