So I am a beginning coder and am attempting to write code to automate the workflow of my team. I am trying to use the specific data below and transcribe it into the format I need using VBA code. Below is a sample of the data I am attempting to transcribe:
Current % | Current Amount | Main Grouping | Grouping | Sub-Grouping | Strategy | |
---|---|---|---|---|---|---|
100% | 900 | |||||
5% | 45 | Animals | Domesticated | |||
5% | 45 | Animals | Domesticated | Cats | ||
5% | 45 | Animals | Domesticated | Cats | ||
50% | 450 | Buildings | Cities | |||
25% | 225 | Buildings | Cities | Skyscrapers | Architectural Strategy 1 | |
25% | 225 | Buildings | Cities | Residential | Architectural Strategy 2 |
I am trying to create a template for data that looks like this and transcribe it to look more like this:
Groupings | Current Amount | Current % |
---|---|---|
Domestic Animals (Bolded, Font 16, Times New Roman) | 45 | 5 |
Cities (Bolded, Font 16, Times New Roman) | 450 | 50 |
Architectural Strategy 1 (Font 14, Times New Roman) | 225 | 25 |
Architectural Strategy 2 (Font 14, Times New Roman) | 225 | 25 |
Essentially, I am trying to get code to detect what is under the main grouping, copy and structure it in a way that puts the groupings as headers and subsequently, underneath them, put the strategies down.
Would love to just get a template to get started on some code then I can just learn the rest myself!
This is primarily because I’ve been trying to look for ways to do this code online and learn it, but it’s harder than expected. I’m thinking right now on using if statements to create it, but I’m not sure how to get the code to detect the main grouping, then under main groupings, detect the groupings and subsequently the strategies. I really appreciate all the help. Thank you!
user26702508 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.