I am new to VBA and trying to automate populating an array using a named range on a specific worksheet. The array in question is in bold in below code. The named range is "SheetNames", on a worksheet named "Consolidation", cell B3 to B101.
Sub Insert_Formula() Dim ws As Worksheet Application.ScreenUpdating = False Sheets(Array("Sheet1", "Sheet2")).Select
For Each ws In ActiveWindow.SelectedSheets ws.Range("F3:F50").Formula = "=SUMIFS(Jul!$K:$K,Jul!$H:$H,$C$1,Jul!$J:$J,$C3)" Next ws Application.ScreenUpdating = True End Sub
Any help would be greatly appreciated.