30 Advanced Excel Tips for 2026

Excel Champs / Pivot Table / Dynamic Pivot Table Range that Don’t Needs to Update
By Puneet Gogia (Microsoft MVP)

Dynamic Pivot Table Range that Don’t Needs to Update

30+ Advanced Excel Tips for 2026

No spam. Only Excel Stuff. God Promise. 😊

Click any cell in your source data, press Ctrl + T, check My table has headers and click OK. Build the pivot table from that table, or point an existing one at it through PivotTable Analyze → Change Data Source and type the table name, such as Table1, in the Table/Range box.

The table grows as you add rows or columns, so the pivot table’s range always covers the new data. The pivot table still needs a refresh: press Alt + F5 for that pivot table, Ctrl + Alt + F5 for all of them, or tick Refresh data when opening the file under PivotTable Options → Data.

Without a table, use a dynamic named range. Go to Formulas → Name Manager → New, name it SourceData and enter =OFFSET(Data!$A$1,0,0,COUNTA(Data!$A:$A),COUNTA(Data!$1:$1)) in Refers to, where Data is your sheet name. Then type SourceData in the pivot table’s Table/Range box.

The OFFSET range counts non-blank cells, so a blank cell in column A cuts rows off the bottom, a blank header in row 1 drops columns, and notes typed below the data or beside the headers get pulled in. Keep column A filled on every row and nothing else in column A or row 1, or use the table method, which avoids all of this.

Avoid pointing the pivot table at whole columns, such as A:F, as a shortcut. The empty rows add a (blank) item to your fields, make number fields default to Count instead of Sum, and stop you grouping dates.

Updating a pivot table is a pain, isn’t it? If you use pivot tables in your work frequently, I’m sure you can understand.

The point is, every time you add new data to the source sheet, you need to update the source range of the pivot table before you refresh it.

Now just imagine: if you add data to your source sheet every day, you have to update the source range every day.

And changing the pivot table range every time is a mess. Yes, that’s right, the more frequently you add data, the more you need to update the source range.

So the point is you need a method to update the source range automatically when you add new data.

NOTE: Pivot tables are one of the INTERMEDIATE EXCEL SKILLS.

Apply Table to have an Auto-Updating Pivot Table Range

A few days back I asked John Michaloudis about his million-dollar pivot table advice. He says: Put your source data in a table. Believe me, it’s million-dollar advice.

By applying a table in source data, you don’t need to change the source range of your pivot table again and again.

Whenever you add new data, it will automatically update the pivot table range.

Convert Data into a Table Before Creating a Pivot Table

Every time before creating a pivot table make sure to apply a table to the source data by using the following steps.

  1. Select any of the cells in your data.
  2. Use shortcut key Control + T or Go to → Insert Tab → Tables → Table.
  3. You will get a pop-up window with your current data range.
    add table to update pivot table range
  4. Click OK.
  5. Now, to create a pivot table, select any cell of your data. Go to → Table Design Tab (Design in older versions) → Tools → Summarize with PivotTable.
    new pivot table to update pivot table range
  6. Click OK.

Now, whenever you add new data to your data sheet, it will automatically update the pivot table range, and you just have to refresh your pivot table.

Convert Data into a Table After Creating a Pivot Table

If you already have a pivot table in your worksheet, you can use the following steps to convert your data source into a table.

  1. Select any of the cells in your data source.
  2. Use shortcut key Control + T or Go to → Insert Tab → Tables → Table.
  3. You will get a pop-up window with your current data range.
  4. Click OK.
  5. Now, select any of the cells in your pivot table and Go to → Analyze → Data → Change Data Source → Change Data Source (Drop Down Menu).
  6. You will get a pop-up window to re-select your data source or you can also enter the name of the table into the range input.
    change source data to update pivot table range
  7. Click OK.

From now on, every time you add new data to your source sheet, the pivot table range will grow automatically, and a refresh will show the new data.

Create a Dynamic Pivot Table Range with OFFSET Function

The other best way to update the pivot table range automatically is to use a dynamic range.

Dynamic range can expand automatically whenever you add new data to your source sheet. Following are the steps to create a dynamic range.

  1. Go to → Formulas Tab → Defined Names → Name Manager.
  2. Once you click on Name Manager, you will get a pop-up window.
    use name manager to update pivot table range
  3. In your Name Manager window, click on New to create a named range.
  4. In your new name window, enter
    1. A name for your new range. I am using the name “SourceData”.
    2. Specify the scope of the range. You can specify between the current worksheet or workbook.
    3. Add a comment to describe your named range, if you want. Enter the below formula in the “Refers to” input bar.
      =OFFSET(PivotTableData!$A$1,0,0,COUNTA(PivotTableData!$A:$A),COUNTA(PivotTableData!$1:$1))
  5. In the end, click OK.
create a new name to update pivot table range

Now, you have a dynamic range to create a pivot table.

All you have to do is just create a pivot table with your source data and after that change the source with the named range using the same method which I have used in the first method of tables.

Once you add new data to your source sheet, just refresh your pivot table.

How does this Formula Work?

In the above formula, I have used the OFFSET function to create a dynamic range.

I have mentioned cell A1 as the starting point, and then, without moving any rows or columns (0, 0), I have specified the height and width of the range by using COUNTA.

COUNTA will count the cells with values in column A and row 1 and tell OFFSET to expand its height and width accordingly.

The only thing you have to take care of is that there should be no blank cells in column A and row 1 of your data (and nothing else below or to the right of it in that column and row), or the counts will be off.

OFFSET is a volatile function, so it recalculates every time anything changes in the workbook. In a big file, you can use INDEX instead, which gives the same range without being volatile:

=PivotTableData!$A$1:INDEX(PivotTableData!$A:$Z,COUNTA(PivotTableData!$A:$A),COUNTA(PivotTableData!$1:$1))

Change $A:$Z to cover all the columns your data can have.

Update the Pivot Table using a VBA Code

Most people love to use VBA codes. So here is the code you can use to update the pivot table range with VBA.

Sub UpdatePivotTableRange()

Dim Data_Sheet As Worksheet
Dim Pivot_Sheet As Worksheet
Dim StartPoint As Range
Dim DataRange As Range
Dim PivotName As String
Dim NewRange As String
Dim LastCol As Long
Dim DownCell As Long

'Set Pivot Table & Source Worksheet
Set Data_Sheet = ThisWorkbook.Worksheets("PivotTableData3")
Set Pivot_Sheet = ThisWorkbook.Worksheets("Pivot3")

'Enter in Pivot Table Name
PivotName = "PivotTable2"

'Defining Staring Point & Dynamic Range
Data_Sheet.Activate
Set StartPoint = Data_Sheet.Range("A1")
LastCol = StartPoint.End(xlToRight).Column
DownCell = StartPoint.End(xlDown).Row
Set DataRange = Data_Sheet.Range(StartPoint, Cells(DownCell, LastCol))
NewRange = Data_Sheet.Name & "!" & DataRange.Address(ReferenceStyle:=xlR1C1)

'Change Pivot Table Data Source Range Address
Pivot_Sheet.PivotTables(PivotName). _
ChangePivotCache ActiveWorkbook. _
PivotCaches.Create(SourceType:=xlDatabase, SourceData:=NewRange)

'Ensure Pivot Table is Refreshed
Pivot_Sheet.PivotTables(PivotName).RefreshTable

'Complete Message
Pivot_Sheet.Activate
MsgBox "Your Pivot Table is now updated."

End Sub

Things you have to change before you use it in your workbook.

  1. Line13: Change the name of the source worksheet.
  2. Line14: Change the name of the pivot table sheet.
  3. Line17: Change the name of the pivot table.

If you still have a problem using this code, please write to me in the comment box. Now, let me show you how this code works so that you can easily modify it as per your need.

Set Data_Sheet = ThisWorkbook.Worksheets("PivotTableData3")
Set Pivot_Sheet = ThisWorkbook.Worksheets("Pivot3")

In the above part of the code, we have set the variables for the pivot table and source data worksheets. You can change the name of the worksheet from here.

PivotName = "PivotTable2"

In the above part of the code, enter the name of the pivot table on which you want to use this code.

Data_Sheet.Activate
Set StartPoint = Data_Sheet.Range("A1")
LastCol = StartPoint.End(xlToRight).Column
DownCell = StartPoint.End(xlDown).Row
Set DataRange = Data_Sheet.Range(StartPoint, Cells(DownCell, LastCol))

The above part of the code will create a dynamic range by using cell A1 from the data source worksheet.

It will check the last column and last row with data to create a dynamic range. Every time you run this macro it will create a new dynamic range.

'Ensure Pivot Table is Refreshed
 Pivot_Sheet.PivotTables(PivotName).RefreshTable
 
'Complete Message
 Pivot_Sheet.Activate
 MsgBox "Your Pivot Table is now updated."

The above part of the code will refresh the pivot table and show a message to the user that the pivot table is updated now.

Refresh the Pivot Table Automatically

All the methods above update the range, but you still need to refresh the pivot table to see the new data. You have two ways to make that automatic as well:

  1. Refresh when you open the file: right-click the pivot table ➜ PivotTable Options ➜ Data tab, and tick “Refresh data when opening the file”.
  2. Refresh when you change the data: add the code below to the source sheet’s code module (right-click the sheet tab ➜ View Code). It refreshes all the pivot tables in the workbook whenever a cell on that sheet changes.
Private Sub Worksheet_Change(ByVal Target As Range)
ThisWorkbook.RefreshAll
End Sub

Keep in mind that RefreshAll also refreshes any other connections and queries in the file, which can be slow in a big workbook. You can also refresh all the pivot tables yourself with Ctrl + Alt + F5.

Frequently Asked Questions

Why is my pivot table not showing new data?

Either the new rows are outside the source range, or the pivot table hasn’t been refreshed. Use a table as the source so the range grows, and then refresh with Alt + F5.

Which method should I use?

Use a table in most cases: it needs no formulas or code. Use the dynamic named range when you can’t turn the data into a table, and the VBA code when you want to update and refresh in one click.

Does a pivot table update when I delete rows from the table?

Yes. The table range shrinks when you delete rows, and the pivot table drops those rows after you refresh it.

68 thoughts on “Dynamic Pivot Table Range that Don’t Needs to Update”

  1. This tutorial on pivot tables in Excel is very helpful and easy to follow. It provides step-by-step instructions on how to automatically update the source data range, making it an essential tool for anyone who wants to work efficiently with large amounts of data.

    Reply
  2. Hi there,

    If there is a pivot table built by a certain table range, it is common and easy to make changes in source data and reflect in pivot table by using Pivot table Tools>Analyze>Refresh but how can one reflect changes made in pivot table to source data?

    Reply
  3. This is a great tutorial! I’ve been trying to figure out how to do this for a while.

    Reply
  4. hi there,
    I had a difficulty in updating pivot chart and pivot table. What I want to do is when click Ctrl+Alt+F9, all my data will automatically update and the pivot charts and pivot table will change automatically. But my macros codes were wrong. Any suggestions ? Thank you

    Reply
  5. hello, i think I did all of that correct but getting error (vba run time error ‘1004’: method ‘PivotTables’ of object’_Worksheet’ Failed) below is my code
    ‘=============================================================================================================
    Dim Data_Sheet1 As Worksheet
    Dim Pivot_Sheet1 As Worksheet
    Dim StartPoint As Range
    Dim DataRange As Range
    Dim PivotName1 As String
    Dim NewRange As String
    Dim LastCol As Long

    ‘Set Pivot Table & Source Worksheet
    Set Data_Sheet1 = ThisWorkbook.Worksheets(“Szczegóły”)
    Set Pivot_Sheet1 = ThisWorkbook.Worksheets(“Dane”)

    ‘Enter in Pivot Table Name
    PivotName1 = “Tabela przestawna2”

    ‘Defining Staring Point & Dynamic Range
    Data_Sheet1.Activate
    Set StartPoint = Data_Sheet1.Range(“A1”)
    LastCol = StartPoint.End(xlToRight).Column
    DownCell = StartPoint.End(xlDown).Row
    Set DataRange = Data_Sheet1.Range(StartPoint, Cells(DownCell, LastCol))
    NewRange = Data_Sheet1.Name & “!” & DataRange.Address(ReferenceStyle:=xlR1C1)

    ‘Change Pivot Table Data Source Range Address
    Pivot_Sheet1.PivotTables(PivotName). _
    ChangePivotCache ActiveWorkbook. _
    PivotCaches.Create(SourceType:=xlDatabase, SourceData:=NewRange)

    ‘Ensure Pivot Table is Refreshed
    Pivot_Sheet1.PivotTables(PivotName).RefreshTable

    ‘Complete Message
    Pivot_Sheet1.Activate
    ‘=============================================================================================================

    please help 🙂

    Reply

Leave a Comment