• DİKKAT

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

Listwiev Listeleme Problemi

Ercan6321

Altın Üye
Katılım
14 Temmuz 2017
Mesajlar
44
Excel Vers. ve Dili
Exel 2010 Türkçe
Merhabalar. Hazırladığım listeleme programında listele butonunu tıkladığım zaman user defined type not defined hatası alıyorum. Bu problemi nasıl çözerim. yardımlarınızı bekliyorum.
 

Ekli dosyalar

Merhaba.
Tools / Referances seçin aşağıdaki görselde seçili olan referansı ekleyin.
240952
 
Forma yeni bir listview ekleyin.
Otomatik eklenecektir. Eklediğiniz listviewi daha sonra silebilirsiniz.
 
Neyi göremediniz?
Forma yeni bir listview ekleyin dedim siz ne aradınız?
 
İlginiz ve sabrınız için çok teşekkür ederim. Beceremicem sanırım. Can't fint project or library hatası veriyor.
 
Eğer 64 bit excel kullanıyorsanız ListView hata verecektir.
 
Eğer 64 bit excel kullanıyorsanız ListView hata verecektir.
Merhaba Korhan Bey. Windows 7 32 bit Office kullanıyorum. ListView üzerinde çalışmak istemiştim. O konuda da kendime bir şeyler katmak istedim fakat hatalar oluşunca ertelemem gerekiyor sanırım.
 
Paylaştığınız dosyada veriler DB sayfasından sorgulanıyor. Fakat bu sayfa dosyanızda boş görünüyor.

Kodu aşağıdaki gibi değiştirip deneyiniz.

C++:
Sub calisanListele()
    Dim lst As Object
    Dim ws As Worksheet
    Dim ss As Long
    Dim x As Long
    Dim ed As String
    
    lstCalisanlar.ListItems.Clear
    Set ws = Sheets("AnaSayfa")
    ss = ws.Range("A5000").End(xlUp).Row
    
    For x = 2 To ss
        Set lst = lstCalisanlar.ListItems.Add(Text:=ws.Range("A" & x))
        lst.SubItems(1) = ws.Range("B" & x)
        lst.SubItems(2) = ws.Range("C" & x)
        lst.SubItems(3) = ws.Range("D" & x)
        lst.SubItems(4) = ws.Range("E" & x)
        
        If lst.SubItems(4) = "İLKÖĞRETİM" Then ed = 1
        If lst.SubItems(4) = "LİSE" Then ed = 2
        If lst.SubItems(4) = "ÖNLİSANS" Then ed = 3
        If lst.SubItems(4) = "LİSANS" Then ed = 4
        
        If ed = 1 Then
            lst.ForeColor = &HFF&
            lst.ListSubItems(1).ForeColor = &HFF&
            lst.ListSubItems(2).ForeColor = &HFF&
            lst.ListSubItems(3).ForeColor = &HFF&
            lst.ListSubItems(4).ForeColor = &HFF&
        End If
        If ed = 2 Then
            lst.ForeColor = &HFF00&
            lst.ListSubItems(1).ForeColor = &HFF00&
            lst.ListSubItems(2).ForeColor = &HFF00&
            lst.ListSubItems(3).ForeColor = &HFF00&
            lst.ListSubItems(4).ForeColor = &HFF00&
        End If
        If ed = 3 Then
            lst.ForeColor = &HFF00FF
            lst.ListSubItems(1).ForeColor = &HFF00FF
            lst.ListSubItems(2).ForeColor = &HFF00FF
            lst.ListSubItems(3).ForeColor = &HFF00FF
            lst.ListSubItems(4).ForeColor = &HFF00FF
        End If
    Next

    Set ws = Nothing
End Sub
 
Paylaştığınız dosyada veriler DB sayfasından sorgulanıyor. Fakat bu sayfa dosyanızda boş görünüyor.

Kodu aşağıdaki gibi değiştirip deneyiniz.

C++:
Sub calisanListele()
    Dim lst As Object
    Dim ws As Worksheet
    Dim ss As Long
    Dim x As Long
    Dim ed As String
   
    lstCalisanlar.ListItems.Clear
    Set ws = Sheets("AnaSayfa")
    ss = ws.Range("A5000").End(xlUp).Row
   
    For x = 2 To ss
        Set lst = lstCalisanlar.ListItems.Add(Text:=ws.Range("A" & x))
        lst.SubItems(1) = ws.Range("B" & x)
        lst.SubItems(2) = ws.Range("C" & x)
        lst.SubItems(3) = ws.Range("D" & x)
        lst.SubItems(4) = ws.Range("E" & x)
       
        If lst.SubItems(4) = "İLKÖĞRETİM" Then ed = 1
        If lst.SubItems(4) = "LİSE" Then ed = 2
        If lst.SubItems(4) = "ÖNLİSANS" Then ed = 3
        If lst.SubItems(4) = "LİSANS" Then ed = 4
       
        If ed = 1 Then
            lst.ForeColor = &HFF&
            lst.ListSubItems(1).ForeColor = &HFF&
            lst.ListSubItems(2).ForeColor = &HFF&
            lst.ListSubItems(3).ForeColor = &HFF&
            lst.ListSubItems(4).ForeColor = &HFF&
        End If
        If ed = 2 Then
            lst.ForeColor = &HFF00&
            lst.ListSubItems(1).ForeColor = &HFF00&
            lst.ListSubItems(2).ForeColor = &HFF00&
            lst.ListSubItems(3).ForeColor = &HFF00&
            lst.ListSubItems(4).ForeColor = &HFF00&
        End If
        If ed = 3 Then
            lst.ForeColor = &HFF00FF
            lst.ListSubItems(1).ForeColor = &HFF00FF
            lst.ListSubItems(2).ForeColor = &HFF00FF
            lst.ListSubItems(3).ForeColor = &HFF00FF
            lst.ListSubItems(4).ForeColor = &HFF00FF
        End If
    Next

    Set ws = Nothing
End Sub
şimdi düzeldi. Elinize Sağlık
 
Geri
Üst