merhaba arkadaşlar aşağıdaki makro kodu ile 6 tane sayfamın pivot tablo üzerinden icmalini alıyorum fakat sorun şuki 2 sayfayı veriyor geri kalan 4 sayfayı vermior soruna baktım ama cozemedim bu konuda yardımcı olursanız sevinirim
Private Sub UserForm_Activate()
'On Error Resume Next
baslangic_tarihi = Sheets("ICMAL").Range("A1").Value
bitis_tarihi = Sheets("ICMAL").Range("b1").Value
Worksheets("ICMAL_VERI").Cells.Clear
Label1.Caption = ""
Label2.Caption = ""
UserForm2.Caption = "Sayfalardaki Veri Derleniyor"
TOPLAM_VERI = 0
For n = 1 To 6
Set syf = Worksheets("ST" & n)
TOPLAM_VERI = TOPLAM_VERI + syf.[a65536].End(xlUp).Row - 4
Next
ActiveWorkbook.Names.Add Name:="BSUTUN", RefersToR1C1:="=ICMAL_VERI!R2C2"
ActiveWorkbook.Names.Add Name:="CSUTUN", RefersToR1C1:="=ICMAL_VERI!R2C3"
ActiveWorkbook.Names.Add Name:="ISUTUN", RefersToR1C1:="=ICMAL_VERI!R2C9"
DERLENEN_VERI = 0
For n = 1 To 6
Set syf = Worksheets("ST" & n)
For SAYFA_SATIR = 5 To syf.[a65536].End(xlUp).Row
If DateValue(syf.Cells(SAYFA_SATIR, 1).Value) >= baslangic_tarihi And DateValue(syf.Cells(SAYFA_SATIR, 1).Value) <= bitis_tarihi Then
Sheets("ICMAL_VERI").Range("S" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row + 1)) = _
syf.Range("E" & SAYFA_SATIR).Value & "x" & syf.Range("f" & SAYFA_SATIR).Value & "x" & syf.Range("D" & SAYFA_SATIR).Value
Sheets("ICMAL_VERI").Range("T" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row + 1)) = syf.Name
Sheets("ICMAL_VERI").Range("a" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row + 1) & ":r" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row + 1)).Value = _
syf.Range("a" & SAYFA_SATIR & ":r" & SAYFA_SATIR).Value
Sheets("ICMAL_VERI").Range("K" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row)).Formula = _
"= SUMPRODUCT( ((BSUTUN)=B" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row) & ") * ((CSUTUN) - (ISUTUN)) )"
Sheets("ICMAL_VERI").Range("L" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row)).Formula = _
"= I" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row) & " / SUMPRODUCT( ((BSUTUN)=B" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row) & ") * (CSUTUN) ) "
Sheets("ICMAL_VERI").Range("L" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row)).NumberFormat = "0.00%"
With Worksheets("ICMAL_VERI").Columns("B")
Set ilkkayit = .Find(Sheets("ICMAL_VERI").Cells(Sheets("ICMAL_VERI").[a65536].End(xlUp).Row, 2).Text, LookIn:=xlValues)
If Not ilkkayit Is Nothing Then
If Not ilkkayit.Row = Sheets("ICMAL_VERI").[a65536].End(xlUp).Row Then
Sheets("ICMAL_VERI").Range("C" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row)) = ""
Sheets("ICMAL_VERI").Range("K" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row)) = ""
End If
End If
End With
End If
DERLENEN_VERI = DERLENEN_VERI + 1
DoEvents
Label1.Width = Label2.Width * DERLENEN_VERI / TOPLAM_VERI
Label2.Caption = "%" & Int(DERLENEN_VERI * 100 / TOPLAM_VERI)
Next
Next
UserForm2.Caption = "Sütun Başlıkları Atanıyor"
For n = 1 To 18
If IsEmpty(syf.Cells(4, n).Value) Then Sheets("ICMAL_VERI").Cells(1, n).Value = " " Else Sheets("ICMAL_VERI").Cells(1, n).Value = syf.Cells(4, n).Value
DoEvents
Label1.Width = Label2.Width * n / 18
Label2.Caption = "%" & Int(n * 100 / 18)
Next
Sheets("ICMAL_VERI").Range("S" & 1) = "OLCU"
Sheets("ICMAL_VERI").Range("T" & 1) = "SAYFA"
UserForm2.Caption = "Özet Tablo Yenileniyor"
ActiveWorkbook.Names.Add Name:="ICMAL_LISTE", RefersToR1C1:= _
"=ICMAL_VERI!R1C1:R" & Sheets("ICMAL_VERI").[a65536].End(xlUp).Row & "C20"
ActiveWorkbook.Names.Add Name:="BSUTUN", RefersToR1C1:= _
"=ICMAL_VERI!R2C2:R" & Sheets("ICMAL_VERI").[a65536].End(xlUp).Row & "C2"
ActiveWorkbook.Names.Add Name:="CSUTUN", RefersToR1C1:= _
"=ICMAL_VERI!R2C3:R" & Sheets("ICMAL_VERI").[a65536].End(xlUp).Row & "C3"
ActiveWorkbook.Names.Add Name:="ISUTUN", RefersToR1C1:= _
"=ICMAL_VERI!R2C9:R" & Sheets("ICMAL_VERI").[a65536].End(xlUp).Row & "C9"
ActiveSheet.PivotTables("Özet Tablo 1").RefreshTable
UserForm2.Hide
End Sub
Private Sub UserForm_Activate()
'On Error Resume Next
baslangic_tarihi = Sheets("ICMAL").Range("A1").Value
bitis_tarihi = Sheets("ICMAL").Range("b1").Value
Worksheets("ICMAL_VERI").Cells.Clear
Label1.Caption = ""
Label2.Caption = ""
UserForm2.Caption = "Sayfalardaki Veri Derleniyor"
TOPLAM_VERI = 0
For n = 1 To 6
Set syf = Worksheets("ST" & n)
TOPLAM_VERI = TOPLAM_VERI + syf.[a65536].End(xlUp).Row - 4
Next
ActiveWorkbook.Names.Add Name:="BSUTUN", RefersToR1C1:="=ICMAL_VERI!R2C2"
ActiveWorkbook.Names.Add Name:="CSUTUN", RefersToR1C1:="=ICMAL_VERI!R2C3"
ActiveWorkbook.Names.Add Name:="ISUTUN", RefersToR1C1:="=ICMAL_VERI!R2C9"
DERLENEN_VERI = 0
For n = 1 To 6
Set syf = Worksheets("ST" & n)
For SAYFA_SATIR = 5 To syf.[a65536].End(xlUp).Row
If DateValue(syf.Cells(SAYFA_SATIR, 1).Value) >= baslangic_tarihi And DateValue(syf.Cells(SAYFA_SATIR, 1).Value) <= bitis_tarihi Then
Sheets("ICMAL_VERI").Range("S" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row + 1)) = _
syf.Range("E" & SAYFA_SATIR).Value & "x" & syf.Range("f" & SAYFA_SATIR).Value & "x" & syf.Range("D" & SAYFA_SATIR).Value
Sheets("ICMAL_VERI").Range("T" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row + 1)) = syf.Name
Sheets("ICMAL_VERI").Range("a" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row + 1) & ":r" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row + 1)).Value = _
syf.Range("a" & SAYFA_SATIR & ":r" & SAYFA_SATIR).Value
Sheets("ICMAL_VERI").Range("K" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row)).Formula = _
"= SUMPRODUCT( ((BSUTUN)=B" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row) & ") * ((CSUTUN) - (ISUTUN)) )"
Sheets("ICMAL_VERI").Range("L" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row)).Formula = _
"= I" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row) & " / SUMPRODUCT( ((BSUTUN)=B" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row) & ") * (CSUTUN) ) "
Sheets("ICMAL_VERI").Range("L" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row)).NumberFormat = "0.00%"
With Worksheets("ICMAL_VERI").Columns("B")
Set ilkkayit = .Find(Sheets("ICMAL_VERI").Cells(Sheets("ICMAL_VERI").[a65536].End(xlUp).Row, 2).Text, LookIn:=xlValues)
If Not ilkkayit Is Nothing Then
If Not ilkkayit.Row = Sheets("ICMAL_VERI").[a65536].End(xlUp).Row Then
Sheets("ICMAL_VERI").Range("C" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row)) = ""
Sheets("ICMAL_VERI").Range("K" & (Sheets("ICMAL_VERI").[a65536].End(xlUp).Row)) = ""
End If
End If
End With
End If
DERLENEN_VERI = DERLENEN_VERI + 1
DoEvents
Label1.Width = Label2.Width * DERLENEN_VERI / TOPLAM_VERI
Label2.Caption = "%" & Int(DERLENEN_VERI * 100 / TOPLAM_VERI)
Next
Next
UserForm2.Caption = "Sütun Başlıkları Atanıyor"
For n = 1 To 18
If IsEmpty(syf.Cells(4, n).Value) Then Sheets("ICMAL_VERI").Cells(1, n).Value = " " Else Sheets("ICMAL_VERI").Cells(1, n).Value = syf.Cells(4, n).Value
DoEvents
Label1.Width = Label2.Width * n / 18
Label2.Caption = "%" & Int(n * 100 / 18)
Next
Sheets("ICMAL_VERI").Range("S" & 1) = "OLCU"
Sheets("ICMAL_VERI").Range("T" & 1) = "SAYFA"
UserForm2.Caption = "Özet Tablo Yenileniyor"
ActiveWorkbook.Names.Add Name:="ICMAL_LISTE", RefersToR1C1:= _
"=ICMAL_VERI!R1C1:R" & Sheets("ICMAL_VERI").[a65536].End(xlUp).Row & "C20"
ActiveWorkbook.Names.Add Name:="BSUTUN", RefersToR1C1:= _
"=ICMAL_VERI!R2C2:R" & Sheets("ICMAL_VERI").[a65536].End(xlUp).Row & "C2"
ActiveWorkbook.Names.Add Name:="CSUTUN", RefersToR1C1:= _
"=ICMAL_VERI!R2C3:R" & Sheets("ICMAL_VERI").[a65536].End(xlUp).Row & "C3"
ActiveWorkbook.Names.Add Name:="ISUTUN", RefersToR1C1:= _
"=ICMAL_VERI!R2C9:R" & Sheets("ICMAL_VERI").[a65536].End(xlUp).Row & "C9"
ActiveSheet.PivotTables("Özet Tablo 1").RefreshTable
UserForm2.Hide
End Sub