arkadaşlar merhaba
aşağıdaki kodun süzmek için hücreye yazılan kriteri alan kısmını cumbobox1, cumbobox2, tekstbox1 ve tekstbox2 için uyarlayabilirmisiniz.
aşağıdaki kodun süzmek için hücreye yazılan kriteri alan kısmını cumbobox1, cumbobox2, tekstbox1 ve tekstbox2 için uyarlayabilirmisiniz.
Kod:
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
On Error Resume Next
Range("B11:J65536").Select
Selection.ClearContents
Range("B11").Select
Set S1 = ThisWorkbook.Worksheets("Data")
Set s2 = ThisWorkbook.Worksheets("RAPOR2")
arananil = [B]s2.Cells(2, 4)[/B]
arananişlem = [B]s2.Cells(4, 4)[/B]
arananilktar = [B]s2.Cells(4, 8)[/B]aranansontar =[B] s2.Cells(4, 9)[/B]
For i = 2 To S1.Range("b65536").End(xlUp).Row
If s2.Cells(2, 4) = "" Then arananil = S1.Cells(i, 4)
If s2.Cells(4, 4) = "" Then arananişlem = S1.Cells(i, 5)
If s2.Cells(4, 8) = "" Then arananilktar = S1.Cells(i, 3)
If s2.Cells(4, 9) = "" Then aranansontar = S1.Cells(i, 3)
If (S1.Cells(i, 4) = arananil And S1.Cells(i, 5) = arananişlem And S1.Cells(i, 3) >= arananilktar And S1.Cells(i, 3) <= aranansontar) Then
sonsatir = s2.Range("B65536").End(xlUp).Row + 1
s2.Cells(sonsatir, 2) = S1.Cells(i, 1)
s2.Cells(sonsatir, 3) = S1.Cells(i, 3)
s2.Cells(sonsatir, 4) = S1.Cells(i, 2)
If S1.Cells(i, 8) = "KASKO" Then s2.Cells(sonsatir, 5) = S1.Cells(i, 12)
If S1.Cells(i, 8) = "SİGORTA" Then s2.Cells(sonsatir, 6) = S1.Cells(i, 12)
If S1.Cells(i, 8) = "MUAYENE" Then s2.Cells(sonsatir, 7) = S1.Cells(i, 12)
If S1.Cells(i, 8) = "EGSOZ" Then s2.Cells(sonsatir, 8) = S1.Cells(i, 12)
s2.Cells(sonsatir, 9) = s2.Cells(sonsatir, 5) + s2.Cells(sonsatir, 6) + s2.Cells(sonsatir, 7) + s2.Cells(sonsatir, 8)
s2.Cells(2, 8) = Date
s2.Cells(sonsatir, 10) = 1
End If
Next i
Application.ScreenUpdating = True
MsgBox "İşlem TAMAM.", vbInformation
End Sub
