Sub Exe() Call Refresh1 Call ClearTemp2 Call Copy3 Call ClearCountry4 Call Country5 Call Calculation6 Call Sum_I_J7 Call CopyTempPodsumowanie8 End Sub Sub Refresh1() 'Odswieżenie danych w tabeli przestawnej Sheets("raport").Select Worksheets("Raport").PivotTables("Tabela przestawna1").PivotCache.Refresh ActiveWorkbook.Save End Sub Sub ClearTemp2() ' ' ClearTemp Makro ' Sheets("temp").Select Range("A1:O212").Select Selection.ClearContents Cells.Select With Selection.Interior .Pattern = xlNone .TintAndShade = 0 .PatternTintAndShade = 0 End With Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideVertical) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideHorizontal) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With Range("A1").Select ActiveWorkbook.Save End Sub Sub Copy3() ' ' Copy Makro ' Kopiowanie danych z zakładki podsumowania do temp ' ' Sheets("podsumowanie").Select Range("A3:P3").Select Range(Selection, Selection.End(xlDown)).Select Range(Selection, Selection.End(xlDown)).Select Range("A3:P214").Select Selection.Copy Sheets("temp").Select Range("A3").Select ActiveSheet.Paste Range("A3").Select Application.CutCopyMode = False ActiveWorkbook.Save End Sub Sub ClearCountry4() ' ' Usunięcie kolumny z kodem kraju ' ' Sheets("podsumowanie").Select Columns("B:B").Select Selection.Delete Shift:=xlToLeft Range("A4").Select ActiveWorkbook.Save End Sub Sub Country5() ' ' CountryClient Makro ' Wyrzucenie kodu kraju oraz numeru klienta ' ' Sheets("podsumowanie").Select Columns("B:B").Select Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove Range("B5").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],dane!C[-1]:C[1],3,0)" Range("B5").Select Selection.AutoFill Destination:=Range("B5:B213") Range("B5:B213").Select Range("B4").Select ActiveCell.FormulaR1C1 = "Kraj" Range("B4").Select ActiveWorkbook.Save End Sub Sub Calculation6() ' ' Dane nie przeterminowane oraz przeterminowane skopiowane z Raport Range C:H ' ' Sheets("podsumowanie").Select Range("C5").Select ActiveCell.FormulaR1C1 = "=raport!RC[-1]" Range("C5").Select Selection.AutoFill Destination:=Range("C5:C213") Range("C5:C213").Select Range("C5").Select Selection.AutoFill Destination:=Range("C5:D5"), Type:=xlFillDefault Range("C5:D5").Select Range("D5").Select Selection.AutoFill Destination:=Range("D5:D213") Range("D5:D213").Select Range("D5").Select Selection.AutoFill Destination:=Range("D5:E5"), Type:=xlFillDefault Range("D5:E5").Select Range("E5").Select Selection.AutoFill Destination:=Range("E5:E213") Range("E5:E213").Select Range("E5").Select Selection.AutoFill Destination:=Range("E5:F5"), Type:=xlFillDefault Range("E5:F5").Select Range("F5").Select Selection.AutoFill Destination:=Range("F5:F213") Range("F5:F213").Select Range("F5").Select Selection.AutoFill Destination:=Range("F5:G5"), Type:=xlFillDefault Range("F5:G5").Select Range("G5").Select Selection.AutoFill Destination:=Range("G5:G213") Range("G5:G213").Select Range("G5").Select Selection.AutoFill Destination:=Range("G5:H5"), Type:=xlFillDefault Range("G5:H5").Select ActiveWindow.ScrollColumn = 2 ActiveWindow.ScrollColumn = 3 Range("H5").Select Selection.AutoFill Destination:=Range("H5:H213") Range("H5:H213").Select Range("H5").Select ActiveWorkbook.Save End Sub Sub Sum_I_J7() 'Wyliczenie sum danych przeterminowanych oraz nieprzeterminowanych Sheets("podsumowanie").Select ActiveCell.FormulaR1C1 = "=raport!RC[-6]" Range("I5").Select Selection.AutoFill Destination:=Range("I5:I213") Range("I5:I213").Select Range("J5").Select ActiveCell.FormulaR1C1 = "=RC[-6]+RC[-5]+RC[-4]+RC[-3]" Range("J5").Select Selection.AutoFill Destination:=Range("J5:J213") Range("J5:J213").Select Range("J5").Select ActiveWorkbook.Save End Sub Sub CopyTempPodsumowanie8() ' ' CopyTempPodsumowanie8 ' Kopiowanie danych z poprzedniego raportu płatności przeterminowane oraz nieprzeterminowane ' Sheets("podsumowanie").Select Range("M5").Select ActiveCell.FormulaR1C1 = "=temp!RC[-4]" Range("M5").Select Selection.AutoFill Destination:=Range("M5:M213") Range("M5:M213").Select Range("N5").Select ActiveCell.FormulaR1C1 = "=temp!RC[-4]" Range("N5").Select Selection.AutoFill Destination:=Range("N5:N213") Range("N5:N213").Select Range("P5").Select ActiveCell.FormulaR1C1 = "=temp!RC" Selection.AutoFill Destination:=Range("P5:P213") Range("P5:P213").Select Range("P5").Select ActiveWorkbook.Save End Sub