• 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.

quick code to generate weekly report

new_to_excelvba

New Member
Hi
I am new to excel vba. can someone help me to write a quick code for weekly report. data entries are in yellow and report is required weekwise per format in blue.
thanks in advance
 

Attachments

  • Excel VBA Code Testing.xlsm
    24.7 KB · Views: 13
Using Power Query and download unpivoted data to workbook and running pivot table. Here is Mcode and file. No VBA required. A few manual steps.
Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type datetime}, {"Status1", type text}, {"Status2", type text}, {"Status3", type text}, {"Status4", type text}, {"Week", Int64.Type}}),
    #"Reordered Columns" = Table.ReorderColumns(#"Changed Type",{"Date", "Week", "Status1", "Status2", "Status3", "Status4"}),
    #"Removed Columns" = Table.RemoveColumns(#"Reordered Columns",{"Date"}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Removed Columns", {"Week"}, "Attribute", "Value"),
    #"Reordered Columns1" = Table.ReorderColumns(#"Unpivoted Other Columns",{"Week", "Value", "Attribute"})
in
    #"Reordered Columns1"
 

Attachments

  • Excel VBA Code Testing.xlsm
    37.4 KB · Views: 7
Back
Top