I'm working in a template which is designed to compute tax credits which is a standardized template. The template is organized by account numbers which are all rows.
When I populate this template with real data sets, the data set may have account numbers which are not included in the original template. This is usually the case. It's quite easy to identify which account numbers are missing from the template through performing a vlookup.
However, once I've identified the missing account numbers, I'm struggling to figure out a way to add them into the template without manually adding them. I would also like to ensure they are added in the correct place in the template meaning they are organized in sequential order. All account numbers are formatted as text and are 4 characters long (in both the template and data set). There are many subtotals in the template based on class of account number (first 2 digits in the 4 digit account number) so it isn't as simple as adding the accounts to the end of the template and then sorting sequentially.
Is there a way to take the account numbers which I've identified need to be added to the template, and use a macro to add rows automatically add them in the template and also ensure it is added in the correct section to ensure the subtotals down-add the new accounts properly?
In the attached spreadsheet the "Accounts" tab is the standardized template. The "detail" tab is the dataset. The "Account Compare" tab has a column titled "Accounts to be added" which are all the accounts which need to be added into the template in the "Accounts" tab.
Please let me know if there is an elegant way to do this.
Bookmarks