Help with constants requested

greegan

Well-known Member
Joined
Nov 18, 2009
Messages
644
Office Version
  1. 365
Platform
  1. Windows
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
Code:
    If Prov = "AB" Then
Following this it has formula specific to (in this case) Alberta, ending with an End IF and goes on to
Code:
    If Prov = "BC" Then

Code:
    K1P = K1PfAB * TCP
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...
Code:
    K1P = K1Pf&Prov * TCP
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.
 
Last edited:

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top