Using VBA to create charts


D

Dirk

I am trying to write some VBA code to import data, create a single pivot table and then I want to create charts for each of the pivot table columns. I have the first two steps done but the charts are causing some issues.

I want to create a chart for time/Field_02 and another for time/Field_03. I would prefer using the data from the pivot table but it's not required. Using the imported data is an option.

Using the macro recorder to use the pivot table works but all the columns are pulled in and I have to hide the ones I do not want. I could duplicate the pivot tables but I am trying to do this and keep the size of the file as small as possible.

I am trying to do this in Excel 2010. Any ideas that will


Imported data
-------------
Date Time Field_01 Field_02 Field_03
11/02/2013 00:00:10 Database 201 0 0
11/02/2013 00:00:40 Database 201 9557 4356
11/02/2013 00:01:10 Database 201 9026 5115
11/02/2013 00:01:40 Database 201 8970 4926
11/02/2013 00:02:10 Database 201 9260 5319
11/02/2013 00:02:40 Database 201 8959 4884
11/02/2013 00:03:10 Database 201 9501 4425


Pivot table
-----------
Row Labels Sum of Field_02 Sum of Field_03 Sum of Field_04
00:00:10 0 0 0
00:00:40 9557 94 4356
00:01:10 9026 245 5115
00:01:40 8970 126 4926
00:02:10 9260 54 5319
00:02:40 8959 44 4884
00:03:10 9501 44 4425
00:03:40 6201 48 5513
 
Ad

Advertisements


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