How to Dynamically Reference an Input Sheet Across Hundreds of Worksheets
Question details
The user needs a method to reference a unique row from a master Input Sheet in cell A2 across approximately 800 individual worksheets without manually entering the formula on every single sheet.

- Product
- Spreadsheet
- Device & OS
- not provided
- Scenario
- Distributing specific row data from a central master sheet into hundreds of similarly structured child worksheets.
- Observed behavior
- Currently, formulas are being entered manually on each of the 800 worksheets, which is highly inefficient and prone to errors.
Before applying bulk formulas or running macros, always save a backup copy of your workbook, as grouping sheets or executing VBA code can overwrite existing data.
Use INDIRECT and CELL Functions to Extract Sheet Names Dynamically
This method extracts the sheet's index number from its name and uses it to automatically determine which row to reference on the Input Sheet.
By combining INDIRECT, CELL, MID, and FIND, Excel can read the current worksheet's name. If your sheets are sequentially named (e.g., Sheet1, Sheet2), you can extract that number to offset the row reference dynamically.
Your workbook must be saved at least once for the CELL("filename") function to work properly.
Click on the first worksheet tab (e.g., Sheet1), hold down the 'Shift' key, and click on the last worksheet tab (e.g., Sheet800). This groups the sheets so any formula entered will be applied to all of them simultaneously.
With the sheets grouped, click on cell A2 (or the cell where you want the dynamic reference to appear).
Type the following formula and press Enter: =INDIRECT("'Input Sheet'!A"&SUBSTITUTE(MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255),"Sheet","")+5)
Right-click any worksheet tab at the bottom and select 'Ungroup Sheets' to prevent accidentally overwriting data during further edits.

Use a VBA Macro to Automate Formula Insertion
For massive workbooks, a VBA macro is often faster and less resource-intensive than having volatile INDIRECT functions recalculating across 800 sheets.
Easily Manage Massive Workbooks with WPS Spreadsheet
Handling hundreds of worksheets requires a robust and highly compatible spreadsheet tool. WPS Spreadsheet fully supports advanced functions like INDIRECT and CELL, as well as VBA macros, making it easy to automate tasks without performance drops.
- 1. Open your large workbook in WPS Spreadsheet: Launch WPS Office and open your .xlsx or .xlsm file containing the hundreds of worksheets.
- 2. Access the Developer tools: Navigate to the 'Developer' tab on the ribbon to access the VBA Editor if you prefer the macro approach.
- 3. Apply your automation: Either group the sheets to paste the INDIRECT formula or run the VBA script to instantly map your data across all 800 sheets.

Frequently Asked Questions
Why does the CELL("filename") function return an error or empty result?
The CELL function relies on the file path to determine the worksheet name. If you are working on a brand-new workbook that has not been saved yet, it will return an empty string. Save your workbook first and recalculate.
Can I use 3D references instead of the INDIRECT function?
3D references (like =SUM(Sheet1:Sheet800!A1)) are useful for aggregating the exact same cell across multiple sheets. However, they cannot be used to pull different rows dynamically from a single master sheet into multiple individual sheets.
Will having 800 INDIRECT formulas slow down my workbook?
Yes, INDIRECT is a 'volatile' function, meaning it recalculates every time any change is made in the workbook. If you notice performance issues with 800 sheets, the VBA macro method is recommended as it places standard, non-volatile references instead.
How do I remove the 'Sheet' prefix if my worksheets are named differently?
In the formula method, the SUBSTITUTE function targets the text "Sheet" and replaces it with nothing. If your sheets are named "Data1", "Data2", simply change "Sheet" to "Data" in the SUBSTITUTE parameters.




