See attached workbook for a working solution of a dynamic range "Index" along with a macro to update it only when sheet "Summary" is activated ( or selected)
here is the macro:
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim Ws As Worksheet
Dim i As Integer
'Change Dynamic range "Index" only if Summary sheet is activated
If Sh.Name = "Summary" Then
'Disable the EVENTS procedure so this one is not calling itself over and over
Application.EnableEvents = False
i = 0
'Scan each sheets in the workbook
For Each Ws In ActiveWorkbook.Worksheets
'Except for sheets "Instructions" and "Summary"
'Put worksheet name in dynamic range "Index"
If Ws.Name <> "Summary" And Ws.Name <> "Instructions" Then
Sheets("Instructions").Range("P7").Offset(i) = Ws.Name
i = i + 1
End If
Next
Application.EnableEvents = True
End If
End Sub
We don't want this macro to be activated too often and it makes sense to update the "Index" dynamic range only when you select sheet "Summary" as when you are in any other sheet, results of the formulas in that sheet is not important to us.
Hope this helps
Regards
Bookmarks