I have a User Defined Function that will move values from a summary area to detail rows in another spreadsheet. The application is an income tax calculator tool.
I have one sheet ("W2 Data") that stores information about income and taxes\, which allows for multiple W2 forms for up to 2 taxpayers. (Note for non US readers: Form W2 shows information about income, taxes paid, etc. There are five categories of interest, Federal Income Tax, FICA (Social Security), Medicare, State Tax and Local Tax). Here's what the W2 sheet looks like:
and the Summary area of the W2 sheet looks like this:
I want to move the summary values to another spreadsheet, called TaxesPaid. The problem (and the reason I need to use a UDF) is that if there is no Local tax, then I do not move the information, and if there is no data for Taxpayer 2, then I do not move data for that taxpayer. This means that the Taxes Paid sheet could have 1or 2 rows of taxes paid coming from the W2 sheet. My UDF, called CalculateDeductibleTaxes takes a taxpayer, and moves the appropriate data to the appropriate row:
I'm at a loss to figure out what could be wrong. Any ideas, insights creative suggestions would be appreciated,
Thanks,
Tony
Bookmarks