Option Explicit
Sub deneme()
Dim shA As Worksheet, shR As Worksheet, shG As Worksheet
Dim arrArsivSatir(), arrGunSatir()
Dim arrVeri()
Dim arrGun()
Dim x&, i&, j
Set shA = Sheets("ARŞİV")
Set shR = Sheets("rapor")
Set shG = Sheets("GÜN")
shR.Range("B2:I" & shR.Cells(65536, 2).End(xlUp).Row).ClearContents
[COLOR=darkgreen]'GÜN sayfasındaki, Bugünden büyük tarihler diziye çekiliyor[/COLOR]
For i = 2 To shG.Cells(65536, 2).End(xlUp).Row
If IsDate(shG.Cells(i, "F")) Then
If shG.Cells(i, "F") > Date Then
ReDim Preserve arrGunSatir(x)
arrGunSatir(x) = i
x = x + 1
End If
End If
Next i
If x > 0 Then
ReDim arrVeri(1 To UBound(arrGunSatir) + 1, 1 To 8)
For i = 1 To UBound(arrGunSatir) + 1
For j = 1 To 8
arrVeri(i, j) = shG.Cells(arrGunSatir(i - 1), j + 1)
Next j
Next i
End If
[COLOR=darkgreen]'Rapor sayfasına veriler yazdırılıyor[/COLOR]
If x > 0 Then
shR.Range("B" & shR.Cells(65536, 2).End(xlUp).Row + 1).Resize(UBound(arrVeri), 8) = arrVeri
End If
Erase arrVeri
x = 0
[COLOR=darkgreen]'-------------------------------------------
'ARŞİV sayfasındaki, Bugünden büyük tarihler diziye çekiliyor[/COLOR]
For i = 2 To shA.Cells(65536, 2).End(xlUp).Row
If IsDate(shA.Cells(i, "F")) Then
If shA.Cells(i, "F") > Date Then
ReDim Preserve arrArsivSatir(x)
arrArsivSatir(x) = i
x = x + 1
End If
End If
Next i
If x > 0 Then
ReDim arrVeri(1 To UBound(arrArsivSatir) + 1, 1 To 8)
For i = 1 To UBound(arrArsivSatir) + 1
For j = 1 To 8
arrVeri(i, j) = shA.Cells(arrArsivSatir(i - 1), j + 1)
Next j
Next i
End If
[COLOR=darkgreen]'Rapor sayfasına veriler yazdırılıyor[/COLOR]
If x > 0 Then
shR.Range("B" & shR.Cells(65536, 2).End(xlUp).Row + 1).Resize(UBound(arrVeri), 8) = arrVeri
End If
Set shA = Nothing
Set shR = Nothing
Set shG = Nothing
End Sub