Hello everyone.
I'm fairly certain there's a faster way to do this. Much like previous posts very new to vba, just trying to learn how to do stuff in a more efficient manner. Created this to clear a financial sheet for one month, to get started on the next fiscal year. The three sets past the original set are offset to clear the remaining weeks in the month. (only 4 weeks in this month of the period.) Everything is 7 columns past the previous week, which is why the offset(0, 7). The offset(0, -4) is to move actual from this year to prior year in what will be next year's setup...
Attached is a dummy month
Thanks in advance for any help.
Code
Sub ResetOctober()
'
' Reset October
'
'
Dim actual As Range
Dim projection As Range
Set actual = Range("f6:f26")
Set projection = Range("d6:d26")
On Error Resume Next
actual.Select
Selection.Copy
Selection.Offset(0, -4).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
projection.Select
Selection.SpecialCells(xlCellTypeConstants, 1).Select
Selection.ClearContents
actual.Select
Selection.SpecialCells(xlCellTypeConstants, 1).Select
Selection.ClearContents
actual.Select
Selection.Offset(0, 7).Select
Selection.Copy
Selection.Offset(0, -4).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
projection.Select
Selection.Offset(0, 7).Select
Selection.SpecialCells(xlCellTypeConstants, 1).Select
Selection.ClearContents
actual.Select
Selection.Offset(0, 7).Select
Selection.SpecialCells(xlCellTypeConstants, 1).Select
Selection.ClearContents
actual.Select
Selection.Offset(0, 14).Select
Selection.Copy
Selection.Offset(0, -4).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
projection.Select
Selection.Offset(0, 14).Select
Selection.SpecialCells(xlCellTypeConstants, 1).Select
Selection.ClearContents
actual.Select
Selection.Offset(0, 14).Select
Selection.SpecialCells(xlCellTypeConstants, 1).Select
Selection.ClearContents
actual.Select
Selection.Offset(0, 21).Select
Selection.Copy
Selection.Offset(0, -4).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
projection.Select
Selection.Offset(0, 21).Select
Selection.SpecialCells(xlCellTypeConstants, 1).Select
Selection.ClearContents
actual.Select
Selection.Offset(0, 21).Select
Selection.SpecialCells(xlCellTypeConstants, 1).Select
Selection.ClearContents
Range("a1").Select
End Sub
Display More