• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro to create chart

k3vsmith

Member
I have a report (see BEI Report_test.xls)
I need to create a macro that would build a Sums worksheet which would in turn build a Chart worksheet (see BEI Report_test_Chart.xls)
Attached is an example of the kind of chart I'm looking for (Chart example.docx)

To create the sums worksheet, I need assistance.

I think what needs to occur is on the BEI Report worksheet I need to create a new column for each start/Finish so that it reads mm-yyyy. Or reformat the existing dates in all the start/finishes to show as mm-yyyy.
Then on the sums worksheet, list all dates (mm-yyyy) in order across row 2 and row 11 that are available in BEI Report from earliest to latest.

Then somehow show the sums on each. This will help build the chart. See Sums.docx for what I was thinking.

Need help please.
 

Attachments

  • BEI Report_test.xls
    197 KB · Views: 1
  • BEI Report_test_Chart.xls
    226 KB · Views: 3
I have a non-vba, Non-Formulaic approach which unfortunately is only available in Excel 2013 and 2016

I hope you can follow

1. Adjust the Column layout and Make the Table a Table using , Insert Table
upload_2016-4-27_22-32-42.png

2. You will need Excel 2013/16 for this step
Select the Table
Goto the Data, From Table function

3. Select the First 4 Columns and then got the Transform, Unpivot Tab
upload_2016-4-27_22-34-54.png

Select Unpivot Other Columns

4. Excel will rearrange the data as:

upload_2016-4-27_22-36-26.png

Then goto the Home, Close and Unload

Continued next post:
 
Last edited:
5. You will now have a new Tab in Excel with your data
There will be 6 times as many rows as before, thats ok

upload_2016-4-27_22-38-58.png

Note there are six entries for every Activity ID and there are 2 new fields Date and Value, I Renamed the Field Date

6. Now add a PT based on this data

upload_2016-4-27_22-41-39.png


7. Now right click on any date at the Top and select Group
Group by Day
Then Format the field as d-mm or d-mmm

8. Enjoy

This uses the technique Chandoo described a few weeks ago at:
http://chandoo.org/wp/2016/03/08/unpivot-and-pivot-pq/

See your revised file attached:
 

Attachments

  • BEI Report_test_Chart.xlsx
    520.1 KB · Views: 4
Thanks Hui. Thats a new feature I was unaware of. Unfortunately we are all on 2010. But with that said you did give me an idea on how to get this to work. I will also have to code this into a macro as this report is ran by many users at different times. I think you gave me enough info though that I can take it from here. Thanks!
 
Back
Top