I have a sheet to calculate points scoring for an incentive I'm running for my staff. (sample sheet has been attached)
I have coded a macro to copy certain cells when it comes to the end of a week so that we can start with fresh figures, but also keep a running total.
If you look at the sample sheet, column X contains the score for the current week, column Y is the previous weeks score and column Z is the running total.
When I run the macro the sum of X & Y is pasted into Z and columns D to U (which contain the point calculations) are cleared which obviously means the value in X is now blank.
This is also reducing the value in Z because the sum X+Y is auto updating.
How can I stop this from happening?
The code I'm currently using is below
Thanks for any help given.![]()
Sub newweek() ' ' newweek Macro ' ' Range("Z6").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])" Range("Z7").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])" Range("Z8").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])" Range("Z9").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])" Range("Z10").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])" Range("Z11").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])" Range("Z12").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])" Range("Z13").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])" Range("Z14").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])" Range("Z15").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])" Range("Z16").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])" Range("Z20").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])" Range("Z21").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])" Range("Z22").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])" Range("Z23").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])" Range("Z24").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])" Range("Z25").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])" Range("Z26").Select ActiveCell.FormulaR1C1 = "=SUM(RC[-2]+RC[-1])" Range("X6:X16").Select Selection.Copy Range("Y6:Y16").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Range("X20:X26").Select Application.CutCopyMode = False Selection.Copy Range("Y20:Y26").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Range("E6:E17").Select Selection.ClearContents Range("G6:G17").Select Selection.ClearContents Range("I6:I17").Select Selection.ClearContents Range("K6:K17").Select Selection.ClearContents Range("M6:M17").Select Selection.ClearContents Range("O6:O17").Select Selection.ClearContents Range("Q6:Q17").Select Selection.ClearContents Range("S6:S17").Select Selection.ClearContents Range("U6:U17").Select Selection.ClearContents Range("E20:E26").Select Selection.ClearContents Range("G20:G26").Select Selection.ClearContents Range("I20:I26").Select Selection.ClearContents Range("K20:K26").Select Selection.ClearContents Range("M20:M26").Select Selection.ClearContents Range("O20:O26").Select Selection.ClearContents Range("Q20:Q26").Select Selection.ClearContents Range("S20:S26").Select Selection.ClearContents Range("U20:U26").Select Selection.ClearContents Range("C6:C16").Select Selection.ClearContents Range("C20:C26").Select Selection.ClearContents End Sub
Bookmarks