How to update COUNTA in a pivot-table

Gingertrees

Well-known Member
Joined
Sep 21, 2009
Messages
697
Hi,
I have a pivot-table built via VBA. I have a list of clients as a Row field, Dates of Service as a Column field, and Case Worker as a page field.

When the pivot table first opens, it displays the total number of clients in the E4 cell with the following formula:
Code:
Dim Abba As Long
    Abba = Application.WorksheetFunction.CountA(Range("A1:A1000"))
'counts clients served; the minus 7 is so it doesn't count the
header and total cells
    Range("E4") = Abba - 7

This number of clients changes when I change from ALL Case Workers to just one. So I could have 100 clients in total, but Case Worker John only has 25.

How can I update that Counta field when I change the case worker?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,216,026
Messages
6,128,363
Members
449,444
Latest member
abitrandom82

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