I have an excel spreadsheet which (using macros) compares two lists and determines the difference in two of the columns.
Specifically, the lists are of expenditures and appropriations on two different days. The practical reason for this is to see what has been adjusted from one day to the next in each account's expenses/appropriations.
The macros work incredibly well, except when I add or delete an account.
How it works now:
- The data is pasted into a tab (named for the month-day).
- Then the compare macro on the Compare tab is initiated using the Compare button.
- The Compare button initiates a prompt for the first day's tab name which is entered in the dialogue box, OK is clicked and then the second days tab name is entered and OK is clicked.
- This two lists are brought into the Compare tab and formulas calculate the difference between the amounts in the Expense and the Encumbrance columns of the two days.
The Problem:
In the attached file, on 2-13, there is no Account named "Fire insurance", but one has been added on 2-14. So when the macro pulls the data from the tabs and puts it in the Compare tab, it is mis-aligned because a new item has been added.
I've looked at options for creating a "master list" based on the two Accounts columns and then using that to determine how to paste the two lists on the Compare tab, but I can't seem to get that to work.
Any ideas or suggestions?
Thank you,
Tom
Bookmarks