veri arama ve listeleme

Katılım
8 Temmuz 2006
Mesajlar
140
Excel Vers. ve Dili
Microsoft Office LTSC Professional Plus 2021 Tr
sn. orion2 eğer olacaksa diğer sayfalarda olduğu gibi tarihi en sola yani A stununa alabiliriz. B stununda olması gerekmiyor. çalışma7 de herhangi bir sorun yok ama çalışma8 de veriler eksik alıyor.
 

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,254
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
Ekli dosyayı inceleyiniz.:cool:
Kod:
Private Sub CommandButton1_Click()
Dim i As Integer, sayfa_adi1, sayfa_adi2, hucre As String
Dim k, j As Byte, sat As Long, sayfa As String, l, p As Byte, sat2, sat3 As Long
ListBox1.Clear: ListBox2.Clear: sat = 0: sat2 = 0: sat3 = 0
If TextBox1.Value = "" Then Exit Sub
For i = 1 To Worksheets.Count
    sayfa_adi1 = Right(Worksheets(i).Name, 5)
    sayfa_adi2 = Right(Worksheets(i).Name, 4)
    If sayfa_adi1 = "(FTR)" Then sayfa = "(FTR)"
    If sayfa_adi2 = "(GR)" Then sayfa = "(GR)"
    If Worksheets(i).Name <> "LİSTE" And sayfa <> "(FTR)" And sayfa <> "(GR)" Then
        For k = 2 To 9
            For j = 5 To 75
                hucre = Sheets(i).Cells(j, k).Value
                If LCase(Replace(Replace(hucre, "I", "ı"), "İ", "i")) = LCase(Replace(Replace(TextBox1.Value, "I", "ı"), "İ", "i")) Then
                    ListBox1.AddItem
                    ListBox1.Column(0, sat) = Sheets(i).Name
                    ListBox1.Column(1, sat) = Sheets(i).Cells(j, k).Address
                    ListBox1.Column(2, sat) = hucre
                    ListBox1.Column(3, sat) = Format(Sheets(i).Cells(j, "A").Value, "dd.mm.yyyy")
                    ListBox1.Column(4, sat) = Sheets(i).Cells(4, k).Value
                    sat = sat + 1
                End If
            Next j
        Next k
    End If
'=====================================================================================
If sayfa = "(FTR)" Then
    For l = 2 To 9
            For p = 5 To 75
                hucre = Sheets(i).Cells(p, l).Value
                If LCase(Replace(Replace(hucre, "I", "ı"), "İ", "i")) = LCase(Replace(Replace(TextBox1.Value, "I", "ı"), "İ", "i")) Then
                    ListBox2.AddItem
                    ListBox2.Column(0, sat2) = Sheets(i).Name
                    ListBox2.Column(1, sat2) = Sheets(i).Cells(p, l).Address
                    ListBox2.Column(2, sat2) = hucre
                    ListBox2.Column(3, sat2) = Format(Sheets(i).Cells(p, "A").Value, "dd.mm.yyyy")
                    ListBox2.Column(4, sat2) = Sheets(i).Cells(4, l).Value
                    sat2 = sat2 + 1
                End If
            Next p
        Next l
    End If
'========================================================================================
If sayfa = "(GR)" Then
    For l = 2 To 12
            For p = 5 To 75
                hucre = Sheets(i).Cells(p, l).Value
                If LCase(Replace(Replace(hucre, "I", "ı"), "İ", "i")) = LCase(Replace(Replace(TextBox1.Value, "I", "ı"), "İ", "i")) Then
                    ListBox3.AddItem
                    ListBox3.Column(0, sat3) = Sheets(i).Name
                    ListBox3.Column(1, sat3) = Sheets(i).Cells(p, l).Address
                    ListBox3.Column(2, sat3) = hucre
                    ListBox3.Column(3, sat3) = Format(Sheets(i).Cells(p, "A").Value, "dd.mm.yyyy")
                    ListBox3.Column(4, sat3) = Sheets(i).Cells(4, l).Value
                    sat3 = sat3 + 1
                End If
            Next p
        Next l
    End If
    sayfa_adi1 = Empty: sayfa_adi2 = Empty
Next i
End Sub
Kod:
Private Sub CommandButton2_Click()
Dim sat, i As Long, k As Byte
Set s1 = Sheets("LİSTE")
sat = s1.Cells(65536, "A").End(xlUp).Row + 1
If ListBox1.ListCount = 0 Then GoTo atla
For i = 0 To ListBox1.ListCount - 1
    For k = 0 To 4
        s1.Cells(sat, k + 1).Value = ListBox1.Column(k, i)
    Next
    s1.Cells(sat, 4).Value = CDate(ListBox1.Column(3, i))
    sat = sat + 1
Next i
atla:
If ListBox2.ListCount = 0 Then GoTo atla2
For i = 0 To ListBox2.ListCount - 1
    For k = o To 4
        s1.Cells(sat, k + 1).Value = ListBox2.Column(k, i)
    Next
    s1.Cells(sat, 4).Value = CDate(ListBox2.Column(3, i))
    sat = sat + 1
Next
atla2:
If ListBox3.ListCount = 0 Then GoTo atla3
For i = 0 To ListBox3.ListCount - 1
    For k = o To 4
        s1.Cells(sat, k + 1).Value = ListBox3.Column(k, i)
    Next
    's1.Cells(sat, 4).Value = CDate(ListBox3.Column(3, i))
    sat = sat + 1
Next
atla3:
MsgBox "LİSTE adlı sayfaya aktarma yapıldı..!!", vbOKOnly + vbInformation
End Sub
 
Katılım
8 Temmuz 2006
Mesajlar
140
Excel Vers. ve Dili
Microsoft Office LTSC Professional Plus 2021 Tr
sn. orion2 listbox3 teki listelenen verileri incelediğimiz zaman ders saatlerinde hata var çalışma sayfasındaki ders saatiyle listbox3 de listelenen ders saatleri farklılık gösteriyor.Listbox3 te tarihler görünmüyor.
aynı zamanda mesela sayfa2(GR)de 6 dersi var öğrencinin ama listbox3'de 5 ders görünüyor, sanırım 4. satırı listbox'ta göstermiyor.
 
Son düzenleme:

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,254
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
Ekli dosyayı inceleyiniz.
GR ie biten sayfalarda a sütununa tarih yazmadığınız için tarih göstermiyordu.
A sütununa tarih yazarsanız tarih göstercektir.Şu anda saat yazıldığı için listbox3'te saat göstariyor.:cool:
 
Katılım
8 Temmuz 2006
Mesajlar
140
Excel Vers. ve Dili
Microsoft Office LTSC Professional Plus 2021 Tr
çok teşekkür ederim sn. orion2 kolay gelsin
 
Katılım
18 Ocak 2007
Mesajlar
136
Excel Vers. ve Dili
2003 türkçe
teşekkürler sn. orion2
Bir ricam daha olacaktı öğrenci aynı gün ve aynı saatte iki derse birden giremeyeceğinden yanlışlıkla yerleştirme ihtimaline karşı listbox1 ve listbox2 de der günler ve saatleri aynı olanların rengi kırmızı olabilir mi.
teşekkürler.
tam bilmiyorum ama belki çakışan veriler bir labelde listelenebilir ???
 
Katılım
8 Temmuz 2006
Mesajlar
140
Excel Vers. ve Dili
Microsoft Office LTSC Professional Plus 2021 Tr
yeni bir &#246;&#287;rencinin aramas&#305;n&#305; yapt&#305;&#287;&#305;m zaman listbox3 te eski &#246;&#287;rencinin verileri kal&#305;yor, bunu nas&#305;l d&#252;zeltebilirim
 

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,254
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
yeni bir öğrencinin aramasını yaptığım zaman listbox3 te eski öğrencinin verileri kalıyor, bunu nasıl düzeltebilirim
Ekli dosyayı inceleyiniz.:cool:
Kod:
Private Sub CommandButton1_Click()
Dim i As Integer, sayfa_adi1, sayfa_adi2, hucre As String
Dim k, j As Byte, sat As Long, sayfa As String, l, p As Byte, sat2, sat3 As Long
ListBox1.Clear: ListBox2.Clear: [B][COLOR="Red"]ListBox3.Clear[/COLOR][/B]: sat = 0: sat2 = 0: sat3 = 0
If TextBox1.Value = "" Then Exit Sub
For i = 1 To Worksheets.Count
    sayfa_adi1 = Right(Worksheets(i).Name, 5)
    sayfa_adi2 = Right(Worksheets(i).Name, 4)
    If sayfa_adi1 = "(FTR)" Then sayfa = "(FTR)"
    If sayfa_adi2 = "(GR)" Then sayfa = "(GR)"
    If Worksheets(i).Name <> "LİSTE" And sayfa <> "(FTR)" And sayfa <> "(GR)" Then
        For k = 2 To 9
            For j = 5 To 75
                hucre = Sheets(i).Cells(j, k).Value
                If LCase(Replace(Replace(hucre, "I", "ı"), "İ", "i")) = LCase(Replace(Replace(TextBox1.Value, "I", "ı"), "İ", "i")) Then
                    ListBox1.AddItem
                    ListBox1.Column(0, sat) = Sheets(i).Name
                    ListBox1.Column(1, sat) = Sheets(i).Cells(j, k).Address
                    ListBox1.Column(2, sat) = hucre
                    ListBox1.Column(3, sat) = Format(Sheets(i).Cells(j, "A").Value, "dd.mm.yyyy")
                    ListBox1.Column(4, sat) = Sheets(i).Cells(4, k).Value
                    sat = sat + 1
                End If
            Next j
        Next k
    End If
'=====================================================================================
If sayfa = "(FTR)" Then
    For l = 2 To 9
            For p = 5 To 75
                hucre = Sheets(i).Cells(p, l).Value
                If LCase(Replace(Replace(hucre, "I", "ı"), "İ", "i")) = LCase(Replace(Replace(TextBox1.Value, "I", "ı"), "İ", "i")) Then
                    ListBox2.AddItem
                    ListBox2.Column(0, sat2) = Sheets(i).Name
                    ListBox2.Column(1, sat2) = Sheets(i).Cells(p, l).Address
                    ListBox2.Column(2, sat2) = hucre
                    ListBox2.Column(3, sat2) = Format(Sheets(i).Cells(p, "A").Value, "dd.mm.yyyy")
                    ListBox2.Column(4, sat2) = Sheets(i).Cells(4, l).Value
                    sat2 = sat2 + 1
                End If
            Next p
        Next l
    End If
'========================================================================================
If sayfa = "(GR)" Then
    For l = 2 To 12
            For p = 4 To 75
                hucre = Sheets(i).Cells(p, l).Value
                If LCase(Replace(Replace(hucre, "I", "ı"), "İ", "i")) = LCase(Replace(Replace(TextBox1.Value, "I", "ı"), "İ", "i")) Then
                    ListBox3.AddItem
                    ListBox3.Column(0, sat3) = Sheets(i).Name
                    ListBox3.Column(1, sat3) = Sheets(i).Cells(p, l).Address
                    ListBox3.Column(2, sat3) = hucre
                    ListBox3.Column(3, sat3) = Format(Sheets(i).Cells(p, "A").Value, "dd.mm.yyyy")
                    ListBox3.Column(4, sat3) = Sheets(i).Cells(1, l).Value
                    sat3 = sat3 + 1
                End If
            Next p
        Next l
    End If
    sayfa_adi1 = Empty: sayfa_adi2 = Empty
Next i
End Sub
 
Katılım
18 Ocak 2007
Mesajlar
136
Excel Vers. ve Dili
2003 türkçe
listbox1'in birinci sutununda sayfa1 yaz&#305;yorsa listbox1'in alt&#305;nc&#305; stununda do&#287;ru ba&#351;ka bir&#351;ey yaz&#305;yorsa listbox1'in alt&#305;nc&#305; stununda yanl&#305;&#351; yazs&#305;n istiyorum nas&#305;l yapabilirim
 

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,254
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
listbox1'in birinci sutununda sayfa1 yazıyorsa listbox1'in altıncı stununda doğru başka birşey yazıyorsa listbox1'in altıncı stununda yanlış yazsın istiyorum nasıl yapabilirim
Bu başlık altındaki konu sonuçlandı.
Bence yeni bir başlık açıp örnek dosya ile birlikte sorunuzu sormanız dağa doğru olacaktır.:cool:
 
Üst