Looking at your sheet, I think we can simplify down the formula insertion to one step, too. Since the sheet names match the column A values exactly, we can use an INDIRECT() formula for the match and just put them all in in one step.
Option Explicit
Sub WeeklyUpdate()
Dim LC As Long
Application.CutCopyMode = False
LC = Cells(2, Columns.Count).End(xlToLeft).Column
If Cells(2, LC) = "Difference" Then
Range(Cells(2, LC - 1), Cells(19, LC)).Copy Cells(2, LC)
Range(Cells(3, LC + 1), Cells(18, LC + 1)).FormulaR1C1 = "=RC[-1]-RC[-2]"
Range(Cells(3, LC), Cells(18, LC)).FormulaR1C1 = "=SUM(INDIRECT(RC1&""!$H:$H""))"
With Range(Cells(3, LC), Cells(18, LC + 1))
.Value = .Value
End With
Else
Range(Cells(2, LC), Cells(19, LC)).Copy Cells(2, LC + 1)
Range(Cells(2, LC), Cells(19, LC)).Copy Cells(2, LC + 2)
Cells(2, LC + 2) = "Difference"
Range(Cells(3, LC + 2), Cells(19, LC + 2)).FormulaR1C1 = "=RC[-1]-RC[-2]"
Range(Cells(3, LC + 1), Cells(18, LC + 1)).FormulaR1C1 = "=SUM(INDIRECT(RC1&""!$H:$H""))"
With Range(Cells(3, LC + 1), Cells(18, LC + 2))
.Value = .Value
End With
End If
Range("A1").Select
End Sub
I also corrected an error in the second half's column-targeting.
Bookmarks