How to Use Reference of Worksheets in Excel (5 Examples)

Download Practice Workbook


Example 1 – Reference Worksheets from Same Workbook

Steps:

  • Click on the desired cell to insert a reference. We have selected cell C5.
  • Enter =.
  • Select any of the sheets as shown in the image below.

reference worksheets in same workbook

  • In the referenced worksheet, choose the cell (cell G6 here) you wish to refer to and press Enter.

choose the cell (cell G6 here) we wish to refer to and press Enter

  • Drag the fill handle to fill up the rest of the cells in the column.

drag the fill handle to fill up the rest of the cells

Read More: Excel VBA Examples with Cell Reference by Row and Column Number


Example 2 – Reference Sheets from Different Workbooks

2.1 Closed Workbook

When you open an additional worksheet and refer to it, you also have to supply the file name with sheet name and cell/range. You have to create a reference for a closed workbook as well as mention the file path.

Steps:

  • A reference to cell G6 in the MARCH worksheet of the sample File workbook is provided below. As this file is not opened, the following formula refers to where the file is stored.
='C:\Users\Desktop\MARCH'!$G$6
  • The following elements are included in the reference:

File Path – the location of the external file is placed

Filename – external workbook name

Sheet Name – the name of the sheet where G6 is located.

Cell/Range Location -the cell (in this case, it is G6).

Note:

When you create external references to open workbooks and then close them, you will notice that the reference changes automatically. After you close the external workbook, Excel inserts a reference to the file path automatically.

formula in the creation of an external reference to an open workbook

the external workbook is closed, Excel automatically inserts a reference to the file path as well


2.2 Opened Workbook

When referencing an external open workbook, you must include the workbook name, worksheet name and cell/range address. The following formula can be used to refer an external open worksheet.

='[FileName]SheetName!CellAddress

Steps: 

  • Click on the desired cell and enter =.

To begin constructing the reference

  • Select the open workbook after placing the cursor on Excel in the taskbar.

Reference Sheets from Different Workbooks

  • Select the required cell that you want in the summary table.

select the required cell

  • Use the Fill Handle tool for the remaining cells.

drag the fill handle down to fill the rest of the cells

  • The cost in March is added to the summary table and the summary table will be displayed as shown in the following image.

the final summary table

Note: The referencing formula for the opened workbook will automatically be changed by Excel after closing the source workbook.

the referencing formula for the opened workbook will automatically be changed

  • Excel has taken the file directory of the source workbook to do the referencing. The fact is that we also have used the very same formula for referencing a cell that is in the closed workbook.

Excel has taken the file directory of the source workbook to do the referencing

Read More: How to Use Cell Value as Worksheet Name in Formula Reference in Excel


Similar Readings


Example 3 – Reference Defined Name from Other Worksheets

Steps:

  • Select all of the cells that you wish to include in the named range.
  • Navigate to the Formulas tab.
  • In the Defined Names group, select the Define Name option.

select the Define Name option

  • Give the cell a name in the New Name dialog box, we have used Big-Mac. Remember that there cannot be any spaces in the name.

Give the cell a name in the New Name dialog box


3.1 Same Workbook

  • We have named a cell in another workbook. We can call that cell by entering the cell’s name in the summary worksheet.

entering the cell's name in the summary worksheet

  • Press Enter, and it will give a cell value like the image below.

get cell value by calling name


3.2 Other Workbook

3.2.1 Opened Workbook

For example, if we have an Excel workbook named source workbook.xlsx and a named range called Hamburger, we can use the following formula to acquire the total of this cell from another workbook:

='source workbook.xlsx'!Hamburger

Note:

If we don’t have space in our workbook, we can use the formula like this:

=sourceworkbook.xlsx!Hamburger

Reference Defined Name from Other Worksheets


3.2.2 Closed Workbook

If we are accessing a named range in a closed workbook, we must also mention the file location. For example,

='C:\Users\Desktop\source workbook.xlsx'!Hamburger

accessing a named range in a closed workbook

Read More: [Fixed!] Relative Cell Reference Not Working in Excel


Example 4 – Excel Reference Cell in Another Sheet Dynamically Based on Value

We can use references from worksheets in the INDIRECT function.

4.1 Same workbook

Suppose, we have some vital data in the APRIL worksheet that we want to extract into a Summary Datasheet. Enter the following formula in cell F7.

=INDIRECT("'"&$G$6&"'!"&G7)
  • Sheet’s name is in $G$6
  • Cell to pull data from in G7

an Excel Indirect formula

Read More: How to Use Cell References in Excel Formula (All Possible Ways)


4.2 Another Workbook

We intend to construct a standard reference to another book (apostrophes are used if our book and/or sheet titles include spaces):

=INDIRECT("'["&$H$8&"]"&$I$8&"'!"&J8)
  • Book name in $H$8
  • Sheet name in $I$8
  • Cell address in J8

to construct a standard reference to another book

Read More: Excel VBA: Cell Reference in Another Sheet (4 Methods)


Example 5 – Reference Worksheet by Name in VBA

5.1 Reference with Code Name of Sheet

Even if you change the sheet names, Excel can still recognize the sheets by their code names (sheet1, sheet2, and so on). So, you can reference worksheets using their code names.

Example:

Sheet1.Range("F9").Value = 79

>> This macro will return value 79 (numeric value), in cell F9 of sheet1.


5.2 Reference By Sheet Name

If you change the worksheet names, you can still reference them in VBA. In that case, you have to enter the sheet name in double quotes like the following macro.

Example:

ThisWorkbook.Worksheets("JANUARY").Range("F9").Value = 79

>> This macro will find the worksheet named JANUARY from the workbook and return 79 in cell F9.


5.3 Reference to Currently Viewed Worksheet

If you move from the currently viewed worksheet, you can still reference them in VBA. In that case, you have to use the following macro.

Example:

ActiveSheet.Range("F9").Value = 79

>> This macro will find the currently viewed worksheet from the workbook and return 79 in cell F9.


5.4 Reference According to Worksheet Position

If you move among multiple worksheets, you can still reference them according to the worksheet position in VBA. In that case, you have to use the following macro.

Example:

ThisWorkbook.Worksheets(1).Range("F9").Value = 79

>> This macro will find the first worksheet from the workbook and return 79 in cell F9.


5.5 Reference of Last Worksheet

Whether you move among multiple worksheets, you can still reference them according to the worksheet position in VBA. In that case, you have to use the following macro.

Example:

ThisWorkbook.Worksheets(ThisWorkbook.Sheets.Count).Range("F9").Value = 79

>> This macro will find the last worksheet from the workbook and return 79 in cell F9.


5.6 Reference Worksheet in Another Workbook

Whether you move among multiple workbooks, you can still reference them in VBA. In that case, you have to use the following macro.

Example:

Workbooks("relative-absolute-references").Worksheets("Summary Data").Range("F9").Value = 79

> This macro will find the Summary Data worksheet from the workbook named relative-absolute-references and return 79 in cell F9 in that worksheet.


Related Articles

Get FREE Advanced Excel Exercises with Solutions!
Kawser Ahmed
Kawser Ahmed

Kawser Ahmed is a Microsoft Excel Expert, Udemy Course Instructor, Data Analyst, Finance professional, and Chief Editor of ExcelDemy. He is the founder and CEO of SOFTEKO (a software and content marketing company). He has a B.Sc in Electrical and Electronics Engineering. As a Udemy instructor, he offers 8 acclaimed Excel courses, one selected for Udemy Business. A devoted MS Excel enthusiast, Kawser has contributed over 200 articles and reviewed thousands more. His expertise extends to Data Analysis,... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo