Refresh Excel Pivot Table When New Data is Added using VBA

G

Guest

Hi there,

I have set up a pivot table and I use the following VBA to refresh.

ActiveSheet.PivotTables(PivotTable1).RefreshTable

My pivot table select the entire columns as its range and when data gets too
large, it crashes the computer.

Could you tell me how to specify the range so it would automatically pick
all the data up to the last row?

I have also specify last row with this VBA:
LastSales = SalesWS.Cells.Find(What:="*", SearchDirection:=xlPrevious,
SearchOrder:=xlByRows).Row


Many thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top