Here I present a generic VBA template which shows some basic elements of good programming style.
We create an email which shows a list of the capacity of all operating nuclear reactors, aggregated by country and decade. Please notice that I used just fictive test data. If you are interested in real data look at the Guardian's website, for example.
This is done in four steps:
1. Read the input file
2. Reduce the input data to country, decade of start and net capacity
3. Create a Pivot table which aggregates by country and decade
4. Prepare an email