autoupdating a pivottable (but only when theres enough data to make the table)

N

neowok

basically trying to put something in worksheet_change so that it aut
updates my pivottable, but ONLY when theres enough data on the sheet t
make the pivottable in the first place, so that when a new blan
version of my workbook is started, the user doesnt get an error fo
every cell they change.

If (Not (IsEmpty(Cells(a4)) = "" Or IsEmpty(Cells(a5)) = "")) The
Worksheets("Planned+Actual men char
data").PivotTables(1).RefreshTable

thats the code im trying to use but its producing an "applicatio
defined or object defined error" whenever i change a cell. cells A
and A5 are the first rows of my data table which would go into th
pivottable, and the pivottable will work ok if heres 2 rows of data t
base the table and pivotchart on, so if these 2 cells are not empty, i
theory someone has filled them in and the chart can now be created.
thats if i can make this code wor
 
D

Debra Dalgleish

Instead of refreshing the PivotTable every time the worksheet is
changed, you could refresh when the PivotTable worksheet is activated.
 
N

neowok

hmm yes that would pretty much solve it :p

ill need to do it when the pivotchart is activated though as th
pivottable is on its own hidden sheet since users have no need to se
it. ill stick it in chart_activate should do the same thing.

thank
 

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