Hot answers tagged vba
If you want to make it accurate you can try out the formula =(YEAR(E2)-YEAR(D2))*12+MONTH(E2)-MONTH(D2)-(DAY(E2)<DAY(D2)) the formula should be self explanatory except the last part -(DAY(E2)<DAY(D2)), which subtracts one month if it is not a complete month.
I would use the Excel Table feature, and not create a macro. I would convert the "database" from a range to an Excel Table (Select range, Insert Ribbon / Table). Then I would use the Filter buttons that will appear next to each column heading to filter the data as required. Multiple criteria can be used and it will show all matching rows.
The following module takes a range and replaces cell references with values found in the referenced cells. Uses Range.Precedents to get the referenced cell addresses to a string and Split to transform it to an array of cell addresses. This array is then used to find and replace matching text in the formula of the target cell. Usage Copy the entire code to ...
Only top voted, non community-wiki answers of a minimum length are eligible