Klavye Kısayolu: Ctrl+Shift+K
'
Rows("1:1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$J$234").AutoFilter Field:=9, Criteria1:= _
"FATURA DURUMU"
Rows("18:147").Select
Selection.Delete Shift:=xlUp
ActiveSheet.Range("$A$1:$J$229").AutoFilter Field:=9
ActiveWindow.SmallScroll Down:=-12
Range("L2").Select
ActiveCell.FormulaR1C1 = "1"
Range("L2").Select
Selection.Copy
Columns("A:K").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
Range("K1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "TESLİM ALAN"
Range("K1").Select
Selection.AutoFilter
Selection.AutoFilter
ActiveWindow.SmallScroll Down:=-3
Range("K2").Select
Sheets("Sayfa2").Select
Windows("AvansTakip 2017.xlsx").Activate
ActiveWindow.SmallScroll Down:=-9
Range("A4:B5").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.SmallScroll Down:=9
Selection.Copy
Windows("Kitap2").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sayfa1").Select
Range("K2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-8],Sayfa2!C[-10]:C[-9],2,0)"
Range("K3").Select
ActiveWindow.SmallScroll Down:=-9
Range("K2").Select
Selection.AutoFill Destination:=Range("K2:K1048576")
Range("K2:K1048576").Select
ActiveWindow.SmallScroll Down:=183
ActiveWindow.ScrollRow = 1
ActiveWindow.SmallScroll Down:=-12
Sheets("Sayfa3").Select
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Sayfa1!R1C1:R1048576C11", Version:=xlPivotTableVersion14).CreatePivotTable _
TableDestination:="Sayfa3!R1C1", TableName:="PivotTable2", DefaultVersion _
:=xlPivotTableVersion14
Sheets("Sayfa3").Select
Cells(1, 1).Select
With ActiveSheet.PivotTables("PivotTable2").PivotFields("FATURA DURUMU")
.Orientation = xlRowField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable2").PivotFields("TESLİM ALAN")
.Orientation = xlRowField
.Position = 2
End With
ActiveSheet.PivotTables("PivotTable2").AddDataField ActiveSheet.PivotTables( _
"PivotTable2").PivotFields("DÖKÜM NO"), "Toplam DÖKÜM NO", xlSum
With ActiveSheet.PivotTables("PivotTable2").PivotFields("FATURA TÜRÜ")
.Orientation = xlColumnField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable2")
.InGridDropZones = True
.RowAxisLayout xlTabularRow
End With
ActiveSheet.PivotTables("PivotTable2").InGridDropZones = False
ActiveSheet.PivotTables("PivotTable2").TableStyle2 = "PivotStyleMedium4"
With ActiveSheet.PivotTables("PivotTable2").PivotFields("TESLİM ALAN")
.PivotItems("#N/A").Visible = False
End With
ActiveWindow.SmallScroll Down:=-12
With ActiveSheet.PivotTables("PivotTable2").PivotFields("Toplam DÖKÜM NO")
.Caption = "Say DÖKÜM NO"
.Function = xlCount
End With
Columns("C:C").EntireColumn.AutoFit
Range("D2").Select
ActiveSheet.PivotTables("PivotTable2").PivotFields("FATURA TÜRÜ").PivotItems( _
"C Grubu Sıralı Dağıtım").Caption = "C Grubu"
Range("E2").Select
ActiveSheet.PivotTables("PivotTable2").PivotFields("FATURA TÜRÜ").PivotItems( _
"Yurtdışı Sigortalı Normal").Caption = "Yurtdışı"
Range("E3").Select
Columns("E:E").EntireColumn.AutoFit
Columns("D
").EntireColumn.AutoFit
Columns("D:F").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Font.Size = 10
Columns("A:F").Select
Selection.Font.Size = 10
Cells.Select
Cells.EntireColumn.AutoFit
Range("A8").Select
ActiveSheet.PivotTables("PivotTable2").ShowDrillIndicators = False
Columns("A:A").EntireColumn.AutoFit
Range("B2").Select
ActiveSheet.PivotTables("PivotTable2").PivotFields("TESLİM ALAN").Subtotals = _
Array(False, False, False, False, False, False, False, False, False, False, False, False)
ActiveSheet.PivotTables("PivotTable2").PivotFields("TESLİM ALAN").Subtotals = _
Array(True, False, False, False, False, False, False, False, False, False, False, False)
Range("A2").Select
Selection.ShowDetail = True
ActiveWindow.SmallScroll Down:=-9
Range("B2").Select
With ActiveSheet.PivotTables("PivotTable2").PivotFields("ÖDEME DURUMU")
.Orientation = xlRowField
.Position = 3
End With
Columns("B:B").EntireColumn.AutoFit
ActiveWindow.SmallScroll Down:=-9
With ActiveSheet.PivotTables("PivotTable2").PivotFields("FATURA DURUMU")
.PivotItems("0").Visible = False
End With
ActiveWindow.SmallScroll Down:=-9
With ActiveSheet.PivotTables("PivotTable2").PivotFields("TESLİM ALAN")
.PivotItems("0").Visible = False
End With
ActiveWindow.SmallScroll Down:=3
End Sub
kOLAY GELSİN BEN BİRLEŞTİR KOMUTLU BİR MAKRI İLE 3-4 FARKLI EXCELİ BİRLEŞTİRİYORUM. ANCAK HER SEFERİNDE KİTAP İSMİ DEĞİŞİYOR. YUKARIDAKİ MAKROYU KİTAP2 YE BAĞLI KALMADN HERHANGİ BİR KİTAP"" İSMİYLE NASIL ÇALIŞTIRABİLİRİM. HATA VEREN KOD KIRMIZI
'
Rows("1:1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$J$234").AutoFilter Field:=9, Criteria1:= _
"FATURA DURUMU"
Rows("18:147").Select
Selection.Delete Shift:=xlUp
ActiveSheet.Range("$A$1:$J$229").AutoFilter Field:=9
ActiveWindow.SmallScroll Down:=-12
Range("L2").Select
ActiveCell.FormulaR1C1 = "1"
Range("L2").Select
Selection.Copy
Columns("A:K").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
Range("K1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "TESLİM ALAN"
Range("K1").Select
Selection.AutoFilter
Selection.AutoFilter
ActiveWindow.SmallScroll Down:=-3
Range("K2").Select
Sheets("Sayfa2").Select
Windows("AvansTakip 2017.xlsx").Activate
ActiveWindow.SmallScroll Down:=-9
Range("A4:B5").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.SmallScroll Down:=9
Selection.Copy
Windows("Kitap2").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sayfa1").Select
Range("K2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-8],Sayfa2!C[-10]:C[-9],2,0)"
Range("K3").Select
ActiveWindow.SmallScroll Down:=-9
Range("K2").Select
Selection.AutoFill Destination:=Range("K2:K1048576")
Range("K2:K1048576").Select
ActiveWindow.SmallScroll Down:=183
ActiveWindow.ScrollRow = 1
ActiveWindow.SmallScroll Down:=-12
Sheets("Sayfa3").Select
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Sayfa1!R1C1:R1048576C11", Version:=xlPivotTableVersion14).CreatePivotTable _
TableDestination:="Sayfa3!R1C1", TableName:="PivotTable2", DefaultVersion _
:=xlPivotTableVersion14
Sheets("Sayfa3").Select
Cells(1, 1).Select
With ActiveSheet.PivotTables("PivotTable2").PivotFields("FATURA DURUMU")
.Orientation = xlRowField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable2").PivotFields("TESLİM ALAN")
.Orientation = xlRowField
.Position = 2
End With
ActiveSheet.PivotTables("PivotTable2").AddDataField ActiveSheet.PivotTables( _
"PivotTable2").PivotFields("DÖKÜM NO"), "Toplam DÖKÜM NO", xlSum
With ActiveSheet.PivotTables("PivotTable2").PivotFields("FATURA TÜRÜ")
.Orientation = xlColumnField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable2")
.InGridDropZones = True
.RowAxisLayout xlTabularRow
End With
ActiveSheet.PivotTables("PivotTable2").InGridDropZones = False
ActiveSheet.PivotTables("PivotTable2").TableStyle2 = "PivotStyleMedium4"
With ActiveSheet.PivotTables("PivotTable2").PivotFields("TESLİM ALAN")
.PivotItems("#N/A").Visible = False
End With
ActiveWindow.SmallScroll Down:=-12
With ActiveSheet.PivotTables("PivotTable2").PivotFields("Toplam DÖKÜM NO")
.Caption = "Say DÖKÜM NO"
.Function = xlCount
End With
Columns("C:C").EntireColumn.AutoFit
Range("D2").Select
ActiveSheet.PivotTables("PivotTable2").PivotFields("FATURA TÜRÜ").PivotItems( _
"C Grubu Sıralı Dağıtım").Caption = "C Grubu"
Range("E2").Select
ActiveSheet.PivotTables("PivotTable2").PivotFields("FATURA TÜRÜ").PivotItems( _
"Yurtdışı Sigortalı Normal").Caption = "Yurtdışı"
Range("E3").Select
Columns("E:E").EntireColumn.AutoFit
Columns("D
Columns("D:F").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Font.Size = 10
Columns("A:F").Select
Selection.Font.Size = 10
Cells.Select
Cells.EntireColumn.AutoFit
Range("A8").Select
ActiveSheet.PivotTables("PivotTable2").ShowDrillIndicators = False
Columns("A:A").EntireColumn.AutoFit
Range("B2").Select
ActiveSheet.PivotTables("PivotTable2").PivotFields("TESLİM ALAN").Subtotals = _
Array(False, False, False, False, False, False, False, False, False, False, False, False)
ActiveSheet.PivotTables("PivotTable2").PivotFields("TESLİM ALAN").Subtotals = _
Array(True, False, False, False, False, False, False, False, False, False, False, False)
Range("A2").Select
Selection.ShowDetail = True
ActiveWindow.SmallScroll Down:=-9
Range("B2").Select
With ActiveSheet.PivotTables("PivotTable2").PivotFields("ÖDEME DURUMU")
.Orientation = xlRowField
.Position = 3
End With
Columns("B:B").EntireColumn.AutoFit
ActiveWindow.SmallScroll Down:=-9
With ActiveSheet.PivotTables("PivotTable2").PivotFields("FATURA DURUMU")
.PivotItems("0").Visible = False
End With
ActiveWindow.SmallScroll Down:=-9
With ActiveSheet.PivotTables("PivotTable2").PivotFields("TESLİM ALAN")
.PivotItems("0").Visible = False
End With
ActiveWindow.SmallScroll Down:=3
End Sub
kOLAY GELSİN BEN BİRLEŞTİR KOMUTLU BİR MAKRI İLE 3-4 FARKLI EXCELİ BİRLEŞTİRİYORUM. ANCAK HER SEFERİNDE KİTAP İSMİ DEĞİŞİYOR. YUKARIDAKİ MAKROYU KİTAP2 YE BAĞLI KALMADN HERHANGİ BİR KİTAP"" İSMİYLE NASIL ÇALIŞTIRABİLİRİM. HATA VEREN KOD KIRMIZI
