troubleshooting Question

dynamic data range for excel pivot table and excel graph

Avatar of PeterBaileyUk
PeterBaileyUk asked on
Microsoft Excel
13 Comments3 Solutions424 ViewsLast Modified:
I have a sheet that has raw data and then a pivot table based on that data and then a graph based on the pivot table.

How can I in vba in excel expand the range of the pre existing pivot table and graph automatically.

I was using this to clear down the data on open and prior to appending the data so I think its the reverse of that ie get used range and use that value for the pivot and graph

With Sheets("CW data")
    Intersect(.UsedRange, .Range("A:N")).ClearContents
  End With

help would be appreciated hope i explained it ok.

The width of columns remains constant but not the data rows.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 3 Answers and 13 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros