I may have to bore you with the details of my code later if I cannot get an answer without it. But for the time being I will say this...
I'm in Canada and working on an Excel add-in that will allow the user to find out their Federal and Provincial/Territorial taxes on their paychecks.
I've pretty successful so far. I want to "tighten up" the code and I'm hoping someone here can help with this question.
Of the Provinces and Territories I'm only doing 12 (Quebec is a whole lot of other rules for programming) as each of these follow the same principles as far as the calculations work out.
At the beginning of my code is what each Prov/Terr uses for the Federal tax calculations, its all the same until the end where I use an IF... End IF statement like this
Following this it has formula specific to (in this case) Alberta, ending with an End IF and goes on to
I have this formula (among others) where K1Pf@@ is dependant on the Province code selected in a validation list on the worksheet.
K1PfAB is a declared constant as is K1PfBC and 10 other Prov/Terr.
I was wanting to know if the above K1P= code could look something like this...
I guess I want to be educated a bit more on how I could do something like this.
-- g
PS
Can formulas used throughout my program that repeat with each Prov/Terr be declared as constants or something... I would be willing to send someone the file, but I'm sure the code is way too long for this forum.
I'm in Canada and working on an Excel add-in that will allow the user to find out their Federal and Provincial/Territorial taxes on their paychecks.
I've pretty successful so far. I want to "tighten up" the code and I'm hoping someone here can help with this question.
Of the Provinces and Territories I'm only doing 12 (Quebec is a whole lot of other rules for programming) as each of these follow the same principles as far as the calculations work out.
At the beginning of my code is what each Prov/Terr uses for the Federal tax calculations, its all the same until the end where I use an IF... End IF statement like this
Code:
If Prov = "AB" Then
Code:
If Prov = "BC" Then
Code:
K1P = K1PfAB * TCP
K1PfAB is a declared constant as is K1PfBC and 10 other Prov/Terr.
I was wanting to know if the above K1P= code could look something like this...
Code:
K1P = K1Pf&Prov * TCP
-- g
PS
Can formulas used throughout my program that repeat with each Prov/Terr be declared as constants or something... I would be willing to send someone the file, but I'm sure the code is way too long for this forum.
Last edited: