Cengizhantr06
Altın Üye
- Katılım
- 16 Mayıs 2020
- Mesajlar
- 301
- Excel Vers. ve Dili
- Office 365 Türkçe
- Altın Üyelik Bitiş Tarihi
- 18-05-2025
Tarih g sütünunda ve textbox2 ilk tarih textbox3 son tarih olacak arama koduna ekleyebilirmiyiz
Option Explicit
Sub Listele()
Dim Son As Long, Veri As Variant, X As Long, Say As Long
Son = Cells(Rows.Count, 1).End(xlUp).Row
If Son < 3 Then Son = 3
Veri = Range("A2:G" & Son).Value
With UserForm2.ListView1
.ListItems.Clear
For X = LBound(Veri, 1) To UBound(Veri, 1)
.ListItems.Add , , Veri(X, 1)
Say = Say + 1
With .ListItems(Say).ListSubItems
.Add , , Veri(X, 2)
.Add , , Veri(X, 3)
.Add , , Veri(X, 4)
.Add , , Veri(X, 5)
.Add , , Veri(X, 6)
.Add , , Veri(X, 7)
.Add , , Say
End With
Next
End With
End Sub
Private Sub TextBox1_Change()
Dim Veri As Variant, X As Long, Son As Long, Aranan As String, Say As Long
Application.ScreenUpdating = 0
If TextBox1 <> "" Then
Son = Cells(Rows.Count, 1).End(3).Row
If Son < 3 Then Son = 3
Veri = Range("A2:G" & Son).Value
Aranan = UCase(Replace(Replace(TextBox1, "ı", "I"), "i", "İ")) & "*"
With UserForm2.ListView1
.ListItems.Clear
For X = LBound(Veri, 1) To UBound(Veri, 1)
If UCase(Replace(Replace(Veri(X, 2), "ı", "I"), "i", "İ")) Like Aranan Then
.ListItems.Add , , Veri(X, 1)
Say = Say + 1
With .ListItems(Say).ListSubItems
.Add , , Veri(X, 2)
.Add , , Veri(X, 3)
.Add , , Veri(X, 4)
.Add , , Veri(X, 5)
.Add , , Veri(X, 6)
.Add , , Veri(X, 7)
.Add , , Say
End With
End If
Next
End With
If Say = 0 Then
Listele
MsgBox "Aranan veri bulunamadı!" & vbLf & vbLf & "Aranan : " & TextBox1, vbExclamation
TextBox1 = ""
End If
Else
Listele
End If
Application.ScreenUpdating = 1
End Sub
Private Sub UserForm_Initialize()
Listele
End Sub
Option Explicit
Sub Listele()
Dim Son As Long, Veri As Variant, X As Long, Say As Long
Son = Cells(Rows.Count, 1).End(xlUp).Row
If Son < 3 Then Son = 3
Veri = Range("A2:G" & Son).Value
With UserForm2.ListView1
.ListItems.Clear
For X = LBound(Veri, 1) To UBound(Veri, 1)
.ListItems.Add , , Veri(X, 1)
Say = Say + 1
With .ListItems(Say).ListSubItems
.Add , , Veri(X, 2)
.Add , , Veri(X, 3)
.Add , , Veri(X, 4)
.Add , , Veri(X, 5)
.Add , , Veri(X, 6)
.Add , , Veri(X, 7)
.Add , , Say
End With
Next
End With
End Sub
Private Sub TextBox1_Change()
Dim Veri As Variant, X As Long, Son As Long, Aranan As String, Say As Long
Application.ScreenUpdating = 0
If TextBox1 <> "" Then
Son = Cells(Rows.Count, 1).End(3).Row
If Son < 3 Then Son = 3
Veri = Range("A2:G" & Son).Value
Aranan = UCase(Replace(Replace(TextBox1, "ı", "I"), "i", "İ")) & "*"
With UserForm2.ListView1
.ListItems.Clear
For X = LBound(Veri, 1) To UBound(Veri, 1)
If UCase(Replace(Replace(Veri(X, 2), "ı", "I"), "i", "İ")) Like Aranan Then
.ListItems.Add , , Veri(X, 1)
Say = Say + 1
With .ListItems(Say).ListSubItems
.Add , , Veri(X, 2)
.Add , , Veri(X, 3)
.Add , , Veri(X, 4)
.Add , , Veri(X, 5)
.Add , , Veri(X, 6)
.Add , , Veri(X, 7)
.Add , , Say
End With
End If
Next
End With
If Say = 0 Then
Listele
MsgBox "Aranan veri bulunamadı!" & vbLf & vbLf & "Aranan : " & TextBox1, vbExclamation
TextBox1 = ""
End If
Else
Listele
End If
Application.ScreenUpdating = 1
End Sub
Private Sub UserForm_Initialize()
Listele
End Sub