Create Same Pivot but filter differnt value in each workbook

Balajibenz

Board Regular
Joined
Nov 18, 2020
Messages
80
Office Version
  1. 2013
Platform
  1. Windows
Hi Team,

I have below code where I am creating new worksheet for each director in the list and named the worksheets to the directors name.

VBA Code:
Sub test()
    Dim a As Variant
    Dim i As Long
    Dim ws As Worksheet
    a = Cells(2, 2).Resize(Cells(Rows.Count, 2).End(xlUp).Row - 1)
    For i = 1 To UBound(a)
        Set ws = ThisWorkbook.Sheets.Add(After:= _
                                         ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count))
        ws.Name = a(i, 1)
    Next
End Sub

I have two source data worksheets which are named as Source1 and Source2. what i am looking for is to create two pivot tables in each worksheets(that are created using above code) for the two sources as below.

VZ India Time data Anlaysis_6th June.xlsx
ABCDEFGH
1Source1Source2
2DirectorApparaoDirectorApparao
3
4Sum of YTDOverall CapSum of Net Billable HoursOverall Cap/Exp
5Level_6CapExpADCapExp
6RAMADOSS, SENTHILNATHAN X (5688836822)56.01%43.99%Ramadoss,Senthilnathan X29.06%70.94%
7THIRUGNANAM, BALAJI (6577110287)82.72%17.28%Reddy,Praveen A10.94%89.06%
8THOTA, RAVI G (4815358132)77.10%22.90%Thirugnanam,Balaji53.93%46.07%
9REDDY, PRAVEEN A (2800398119)30.02%69.98%Thota,Ravi G73.28%26.72%
10KOVELA, RAM P (0372945772)48.42%51.58%Grand Total27.82%72.18%
11Grand Total60.52%39.48%
Apparao


fields and pivot tables will be same but only two filters needs to be changed.

1. Directors field needs to be filtered wrt the directors name(worksheet name)
2. any NA, null, blanks should be removed from Level_6
3. Cap and Exp fields valued should be in Sun and displayed as % of Row total. Thank you in advance.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,223,909
Messages
6,175,315
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top