jdellasala
Well-known Member
- Joined
- Dec 11, 2020
- Messages
- 755
- Office Version
- 365
- Platform
- Windows
- Mobile
- Web
I recently found the 2 year old video Excel Formula to List All Sheet Tab Names and include Hyperlinks which included a sample file. The solution created a Named Range called SheetNames that used the formula
However, both the sample file and a new file I created worked at first, but would eventually return #BLOCKED!. The problem was that Excel 4 Macros are blocked by default in current versions of Excel. I found the fix to that problem at the Microsoft Support site Working with Excel 4.0 macros. which then allowed the formula
to provide a dynamically updated spilled array of Sheet Names which as demonstrated in the video could then be used to create hyperlinks to the appropriate sheet referencing the spilled array values.
Short version of the fix, go to File -> Options -> Trust Center -> [Trust Center Settings] -> Macro Settings -> check the Enable Excel 4.0 macros when VBA macros are enabled box, recommended settings under Macro Settings is Disable VBA macros with notification, then select File Block Settings on the left, and make sure Excel 4 MacroSheets and Add-in Files is checked in the Open column, and under Open behavior for selected file types, select Open selected file types in Protected View and allow editing. (not short, but as short as possible!)
As the video was at least two years old, it was made before LAMBDA was introduced, and well before BYROW was introduced, so I thought it would be easy to create a LAMBDA function that used SheetNames to create a spilled array of hyperlinks to actual sheet names. That solution has eluded me!
Side note - the "&T(NOW())" part of SheetNames returns nothing and is only there to force an update to the array. The downside is that it executes the entire function with every change in the Workbook.
One thing I have learned in attempting to create the LAMBDA is that while Excel 4 macros work in a Named Range, attempting to use them in a formula or LAMBDA just returns a message box "That function isn't valid."!
A LAMBDA function returning a dynamically updated spilled array of hyperlinked worksheet names would certainly be a valuable tool.
Excel Formula:
=REPLACE(GET.WORKBOOK(1),1,FIND("]",GET.WORKBOOK(1)),"")&T(NOW())
However, both the sample file and a new file I created worked at first, but would eventually return #BLOCKED!. The problem was that Excel 4 Macros are blocked by default in current versions of Excel. I found the fix to that problem at the Microsoft Support site Working with Excel 4.0 macros. which then allowed the formula
Excel Formula:
=TRANSPOSE(SheetNames)
Short version of the fix, go to File -> Options -> Trust Center -> [Trust Center Settings] -> Macro Settings -> check the Enable Excel 4.0 macros when VBA macros are enabled box, recommended settings under Macro Settings is Disable VBA macros with notification, then select File Block Settings on the left, and make sure Excel 4 MacroSheets and Add-in Files is checked in the Open column, and under Open behavior for selected file types, select Open selected file types in Protected View and allow editing. (not short, but as short as possible!)
As the video was at least two years old, it was made before LAMBDA was introduced, and well before BYROW was introduced, so I thought it would be easy to create a LAMBDA function that used SheetNames to create a spilled array of hyperlinks to actual sheet names. That solution has eluded me!
Side note - the "&T(NOW())" part of SheetNames returns nothing and is only there to force an update to the array. The downside is that it executes the entire function with every change in the Workbook.
One thing I have learned in attempting to create the LAMBDA is that while Excel 4 macros work in a Named Range, attempting to use them in a formula or LAMBDA just returns a message box "That function isn't valid."!
A LAMBDA function returning a dynamically updated spilled array of hyperlinked worksheet names would certainly be a valuable tool.