[TABLE="width: 500"]
<tbody>[TR]
[TD]Description[/TD]
[TD]Date[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]Item 1[/TD]
[TD]2016/01/26[/TD]
[TD]0.01399[/TD]
[/TR]
[TR]
[TD]Item 2[/TD]
[TD]2016/07/18[/TD]
[TD]0.17513[/TD]
[/TR]
[TR]
[TD]Item 3[/TD]
[TD]2016/06/13[/TD]
[TD]0.02468[/TD]
[/TR]
[TR]
[TD]Item 1[/TD]
[TD]2016/08/15[/TD]
[TD]0.01452[/TD]
[/TR]
</tbody>[/TABLE]
This runs down thousands of rows with various dates and values and descriptions in a sheet called "Data Capture". The descriptions periodically repeat but at different dates and values (e.g. Item 1). More rows are constantly added, so a VBA macro to auto-pivot and arrange as follows into an already existing sheet called "Clean Pivot" would help a lot.
A simple manual pivot results in the following: [edit: values are changed from Sum to Avg in the pivot]
https://ibb.co/droSzw
And after a manual cleanup it results in this usable format:
https://ibb.co/j0VwsG
The cleanup involves
1) removing the first to rows,
2) removing all the "Total" and "Grand Total" columns.
3) removing the "1900" column. (Don't know why it's there in the first place)
4) Renaming "Row Labels" to "Description"
5) Changing the date format to MMM-YY so for example that it runs Dec-16 (Dec 2016) over to Jan-17 (Jan 2017) seamlessly.
6) Converting it from a Range to a Table.
Once it's in this usable format, I've got a number of other macros that I can run.
<tbody>[TR]
[TD]Description[/TD]
[TD]Date[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]Item 1[/TD]
[TD]2016/01/26[/TD]
[TD]0.01399[/TD]
[/TR]
[TR]
[TD]Item 2[/TD]
[TD]2016/07/18[/TD]
[TD]0.17513[/TD]
[/TR]
[TR]
[TD]Item 3[/TD]
[TD]2016/06/13[/TD]
[TD]0.02468[/TD]
[/TR]
[TR]
[TD]Item 1[/TD]
[TD]2016/08/15[/TD]
[TD]0.01452[/TD]
[/TR]
</tbody>[/TABLE]
This runs down thousands of rows with various dates and values and descriptions in a sheet called "Data Capture". The descriptions periodically repeat but at different dates and values (e.g. Item 1). More rows are constantly added, so a VBA macro to auto-pivot and arrange as follows into an already existing sheet called "Clean Pivot" would help a lot.
A simple manual pivot results in the following: [edit: values are changed from Sum to Avg in the pivot]
https://ibb.co/droSzw
And after a manual cleanup it results in this usable format:
https://ibb.co/j0VwsG
The cleanup involves
1) removing the first to rows,
2) removing all the "Total" and "Grand Total" columns.
3) removing the "1900" column. (Don't know why it's there in the first place)
4) Renaming "Row Labels" to "Description"
5) Changing the date format to MMM-YY so for example that it runs Dec-16 (Dec 2016) over to Jan-17 (Jan 2017) seamlessly.
6) Converting it from a Range to a Table.
Once it's in this usable format, I've got a number of other macros that I can run.
Last edited: