Greetings,
I have a macro that takes a range of data (timestamp in column A, machine error in column B), sorts it, makes a pivot table, and charts the data. The user decides beforehand how many errors should be shown on the chart. Then, it calls another sub which deletes all charted series except for the top n errors.
My code does what I want it to do, but it takes a long time. The sorting and pivot table work takes just a second or two, but the process of deleting the undesired series takes 12 seconds.
My question is this: do you know of any way to quickly remove series from a pivot chart? It would be faster if there were some command to clear all series, and then I could add back in the 5 that I want.
Here is the offending code:
Sheet1.textbox1.value refers to a sheet which I have removed for this simplified version of the file; for now you could just substitute it with 3 or 5.
The data in column F is basically just a list of series names, starting in row 3, sorted by frequency of the error, with the most frequent at the top.
Again, the "offending code" does its job correctly. It's just too slow.
I'm running this on a computer with 512 MB of RAM and GHz, so I'm curious to know how fast my macro runs on a faster computer.
Thanks!
-Joe
Edit: forgot to attach the file. The macro to run is Macro1.
Bookmarks