veri arama ve listeleme

Katılım
8 Temmuz 2006
Mesajlar
140
Excel Vers. ve Dili
Microsoft Office LTSC Professional Plus 2021 Tr
merhaba arkadaşlar ekteki dosyada açılan formda arama yapınca aradığım öğrencinin aktif sayfadaki ders tarihleri ve ders saatleri listbox1'de listeleniyor.
Acaba sadece aktif sayfada değil de sayfa adının sonunda (FTR) ve (GR) eki olmayan tüm sayfalarda arama yapıp listbox1'de listeleyebilirmiyiz.

mesela sayfa1'de fatma aydın'ı arayınca sayfa2'deki fatma aydın'ın ders tarihlerini ve ders saatlerinide listbox1'de listelesin istiyorum. Ama sayfa1(FTR) ve sayfa1(GR) de de fatma aydın var oradakilerin listelenmesini istemiyorum.
teşekkürler.
 

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
ListBox1.Clear: sat = 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
        GoTo atla3
        Else
        sayfa = sayfa_adi1
    End If
    If sayfa_adi2 = "(GR)" Then
        GoTo atla3
        Else
        sayfa = sayfa_adi2
    End If
        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) = Cells(j, "A").Value
                    ListBox1.Column(4, sat) = Cells(4, k).Value
                    sat = sat + 1
                End If
            Next j
        Next k
atla3:
    sayfa_adi1 = Empty: sayfa_adi2 = Empty
Next i
End Sub
 
Katılım
8 Temmuz 2006
Mesajlar
140
Excel Vers. ve Dili
Microsoft Office LTSC Professional Plus 2021 Tr
teşekkürler sn. orion2 yapmak istediğim buydu.
Peki arama yaptığımız kişi sonu (FTR) ile biten sayfalarda bulunuyorsa onları da aynı şekilde listbox2 de listeleyebilirmiyiz
 

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
teşekkürler sn. orion2 yapmak istediğim buydu.
Peki arama yaptığımız kişi sonu (FTR) ile biten sayfalarda bulunuyorsa onları da aynı şekilde listbox2 de listeleyebilirmiyiz
Listeleyebiliriz.:cool:
 

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
ListBox1.Clear: ListBox2.Clear: sat = 0: sat2 = 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
        GoTo atla3
        Else
        sayfa = sayfa_adi1
    End If
    If sayfa_adi2 = "(GR)" Then
        GoTo atla3
        Else
        sayfa = sayfa_adi2
    End If
        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) = Cells(j, "A").Value
                    ListBox1.Column(4, sat) = Cells(4, k).Value
                    sat = sat + 1
                End If
            Next j
        Next k
atla3:
'=====================================================================================
If sayfa_adi1 = "(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) = Cells(p, "A").Value
                    ListBox2.Column(4, sat2) = Cells(4, l).Value
                    sat2 = sat2 + 1
                End If
            Next p
        Next l
End If
    sayfa_adi1 = Empty: sayfa_adi2 = Empty
Next i
End Sub
 
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
8 Temmuz 2006
Mesajlar
140
Excel Vers. ve Dili
Microsoft Office LTSC Professional Plus 2021 Tr
listbox1 deki verileri "LİSTE" sayfasına aktardıktan sonra listbox2 deki verileri de "LİSTE" sayfasına aktarmak istiyorum.Yani listbox1 deki ve listbox2 deki verileri alt alta "LİSTE" sayfasına aktarmak istiyorum nasıl yapabilirim.
 
Son düzenleme:
Katılım
8 Temmuz 2006
Mesajlar
140
Excel Vers. ve Dili
Microsoft Office LTSC Professional Plus 2021 Tr
nereye nasıl bir kod yazmalıyım ???
 
Katılım
8 Temmuz 2006
Mesajlar
140
Excel Vers. ve Dili
Microsoft Office LTSC Professional Plus 2021 Tr
arama yapınca diğer sayfadaki öğrenciyi buluyor fakat bulunduğu sayfadaki tarih ve saat değil aktif sayfadaki tarih ve saat listbox ta listeleniyor.
nası düzeltebiliriz.
 

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
arama yapınca diğer sayfadaki öğrenciyi buluyor fakat bulunduğu sayfadaki tarih ve saat değil aktif sayfadaki tarih ve saat listbox ta listeleniyor.
nası düzeltebiliriz.
Hata düzeltildi.
Ekli dosyayı inceleyiniz.:cool:
 
Katılım
8 Temmuz 2006
Mesajlar
140
Excel Vers. ve Dili
Microsoft Office LTSC Professional Plus 2021 Tr
merhaba evet hata giderildi fakat bir sorun daha var liste sayfasındaki kayıtlar yeni kayıt yapınca siliniyor. alt alta sıralayabilirmiyiz.
 
Son düzenleme:
Katılım
8 Temmuz 2006
Mesajlar
140
Excel Vers. ve Dili
Microsoft Office LTSC Professional Plus 2021 Tr
yardımlarınızı bekliyorum arkadaşlar.
 

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
merhaba evet hata giderildi fakat bir sorun daha var liste sayfasındaki kayıtlar yeni kayıt yapınca siliniyor. alt alta sıralayabilirmiyiz.
Bunu önceden belirtseydiniz dosyayı o şekilde hazırlardım.
Neyse istediğiniz şekle getirdim.
Ekli dosyayı inceleyiniz.:cool:
 
Katılım
8 Temmuz 2006
Mesajlar
140
Excel Vers. ve Dili
Microsoft Office LTSC Professional Plus 2021 Tr
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.
 

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
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.
Listbox'ın bu özelliği yok.Ama listview veya spreadsheet kullanabilirsiniz.:cool:
 
Katılım
8 Temmuz 2006
Mesajlar
140
Excel Vers. ve Dili
Microsoft Office LTSC Professional Plus 2021 Tr
teşekkürler sn. orion2 kolay gelsin
 
Katılım
8 Temmuz 2006
Mesajlar
140
Excel Vers. ve Dili
Microsoft Office LTSC Professional Plus 2021 Tr
arkadaşlar son olarak sonunda (GR) olan sayfadaki öğrencilerin ders tarihlerini ve ders saatlerini de listbox3 te listelemek istiyorum.Kaydederken listbox2 nin ardından listbox3 ü de kaydetmek.
teşekkürler
 

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
Listbox2 ve listbox3 fazladan boş listeleme yapıyor.Bu hatayı çözemedim.
İşinize yararsa ekli programı kullanabilirsiniz.: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
ListBox1.Clear: ListBox2.Clear: ListBox3.Clear: sat = 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 = sayfa_adi1
    If sayfa_adi2 = "(GR)" Then sayfa = sayfa_adi2
    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
    sat = 0
        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, sat) = Sheets(i).Name
                    ListBox2.Column(1, sat) = Sheets(i).Cells(p, l).Address
                    ListBox2.Column(2, sat) = hucre
                    ListBox2.Column(3, sat) = Format(Sheets(i).Cells(p, "A").Value, "dd.mm.yyyy")
                    ListBox2.Column(4, sat) = Sheets(i).Cells(4, l).Value
                    sat = sat + 1
                End If
            Next p
        Next l
    End If
'=============================================================
If sayfa = "(GR)" Then
sat = 0
        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, sat) = Sheets(i).Name
                    ListBox3.Column(1, sat) = Sheets(i).Cells(p, l).Address
                    ListBox3.Column(2, sat) = hucre
                    ListBox3.Column(3, sat) = Format(Sheets(i).Cells(p, "A").Value, "dd.mm.yyyy")
                    ListBox3.Column(4, sat) = Sheets(i).Cells(4, l).Value
                    sat = sat + 1
                End If
            Next p
        Next l
End If
Next i
End Sub
 
Üst