Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

304
Views
How can I change the index of a PivotTable

I am trying to automatically mail some reports (which are essentially Pivot Tables) using VBA script. I have multiple Pivot tables in some of my sheets. How do I ensure that a particular Pivot Table is always indexed as 1.

Example:

On a worksheet I two Pivot Tables - PvtTable1 & PvtTable2. In my VBA code, when I reference a Pivot Table using the code, ActiveSheet.PivotTables(1) I want it to always refer it to PvtTable1. Not PvtTable. How can I do that? I don't want to refer my Pivot Tables using their names, as I intend to use my VBA code in a FOR LOOP.

Dim current As Worksheet

For Each current In Worksheets
         <my VBA Code statements>
         Set PvtTableRng = current.PivotTables(1).TableRange1
         <some more VBA Code>
Next 
about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!