Questa è la macro che utilizzo per l’archiviazione dei dati:
- Codice: Seleziona tutto
Sub ArchiviaRicoveriGiornalieri10()
Application.ScreenUpdating = False
Sheets("Archivio").Unprotect ""
Sheets("Movimenti").Unprotect ""
Range("B8:AR24").Select
Selection.Copy
Sheets("Archivio").Visible = True
Sheets("Archivio").Select
Range("B7").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveWindow.SmallScroll Down:=15
ActiveCell.Offset(17, 0).Range("A1").Select
Sheets("Movimenti").Select
Range("Z8:AA8").Select
Application.CutCopyMode = False
Selection.Copy
Range("Z5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("Z8").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=R[-3]C+RC[-4]-RC[-2]"
Range("AA8").Select
ActiveCell.FormulaR1C1 = "=R[-3]C+RC[-4]-RC[-2]"
Range("E8:H24").Select
Range("E8:H24,J8:J24,N8:O24").Select
Range("N8").Activate
Selection.ClearContents
ActiveSheet.Range("F4").Value = ActiveSheet.Range("F4").Value + 1
Range("F4").Select
Sheets("Archivio").Visible = False
Application.CutCopyMode = False
MsgBox ("Fatto")
Application.ScreenUpdating = True
Sheets("Movimenti").Protect ""
Sheets("Archivio").Protect ""
Application.ScreenUpdating = True
End Sub