• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

ComboBox ta listelemeyi 2. satırdan yapsın

Katılım
23 Şubat 2007
Mesajlar
1,212
Excel Vers. ve Dili
Excel2003
Değerli Dostlar Selamlar,
Aşağıdaki kod ile listview e veri alıyorum. Ancak ComboBoxta listelenen veriye başlık satırı eklenmesin ist,yorum.
Private Sub ComboBox1_Change()
Set S1 = Sayfa2
ListView1.ListItems.Clear
For n = 2 To [e65536].End(3).Row
If S1.Cells(n, "e") = ComboBox1 Then
s = ListView1.ListItems.Count
ListView1.ListItems.Add , , S1.Cells(n, "a")
For a = 1 To 6
ListView1.ListItems(s + 1).SubItems(a) = S1.Cells(n, a + 1)
Next
End If
Next
Set S1 = Nothing
End Sub

Private Sub UserForm_Initialize()
Sheets("işleticiler").Select
Set S1 = Sayfa2
For n = 2 To [e65536].End(3).Row
If S1.Cells(n, "e") <> S1.Cells(n + 1, "e") Then
ComboBox1.AddItem S1.Cells(n, "e")
End If
Next
ListView1.View = lvwReport
For a = 1 To 7
ListView1.ColumnHeaders.Add , , S1.Cells(1, a)
Next
ListView1.FullRowSelect = True
ListView1.Gridlines = True
Set S1 = Nothing
End Sub
Nasıl bir değişiklik yapmalıyım.
 
Sizin combobox'a veri aldığınız kodlar;

Private Sub UserForm_Initialize()
Sheets("işleticiler").Select
Set S1 = Sayfa2
For n = 2 To [e65536].End(3).Row
If S1.Cells(n, "e") <> S1.Cells(n + 1, "e") Then
ComboBox1.AddItem S1.Cells(n, "e")
End If
Next

ise

For n = 2 To [e65536].End(3).Row

satırında

For n = 2 To S1.[e65536].End(3).Row

değişiklik yaparak deneyiniz.

Ayrıca Set S1 = Sayfa2 satırı Set S1 = Sheets("Sayfa2") olması gerekebilir.
 
Recep Bey Te&#351;ekk&#252;rler.
 
Geri
Üst