Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-19-2020, 01:41 PM
geepxz geepxz is offline Calculating tax rate per province in VB Windows 10 Calculating tax rate per province in VB Office 2019
Novice
Calculating tax rate per province in VB
 
Join Date: Mar 2020
Posts: 2
geepxz is on a distinguished road
Default Calculating tax rate per province in VB

SHORT REQUEST: im looking for the VBA syntax for an IF function that references a bookmark drop down value in a word document.



IN DEPTH:I have a template I am currently working on and I would like it to automatically calculate the tax rate.

First I have drop downs. We first select CA or US, depending on country is selected the Province/State dropdown changes. This is adone in VB.

Code:
Sub PopulatedRegion()
    Select Case ActiveDocument.FormFields("ddCountry").Result
    Case "CA"
        With ActiveDocument.FormFields("ddRegion").DropDown.ListEntries
            .Clear
            .Add "AB"
            .Add "BC"
            .Add "MB"
            .Add "NB"
            .Add "NL"
            .Add "NT"
            .Add "NS"
            .Add "NU"
            .Add "ON"
            .Add "PE"
            .Add "QC"
            .Add "SK"
            .Add "YT"
        End With
    Case "USA"
        With ActiveDocument.FormFields("ddRegion").DropDown.ListEntries
            .Clear
            .Add "AL"
            .Add "AK"
            .Add "AZ"
            .Add "AR"
            .Add "CA"
            .Add "CO"

etc...
We do not charge tax for the US.

Now for Canada, later in the document I have a bookmark [TOTAL_FEES] and the advance payment [TOTAL_FEES/2] which is saved under [HALF_FEES].

I then add the admin fees which are taxable so it gives me [HALF_FEES*1.05] aka [HALF_FEES2]. So far all works great but now the hard part. I would like to find a way in VB (If possible id rather not put a table in there) to create an IF formula that would work with the selected province in the drop down. For exemple if Ontario [ON] (13% tax) is selected my formula would become [HALF_FEES2*1.13].



Does this make any sense? Someone here able to help?
Reply With Quote
 

Tags
drop down, formula, formulas drop downs



Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating the duration of a task based on work rate Rida Project 0 04-26-2018 03:55 AM
Calculating tax rate per province in VB Average Billing Rate tbrozovich Project 2 08-18-2015 04:00 PM
Calculating tax rate per province in VB Total Hours * hourly rate medavidcook Excel 7 06-04-2015 09:29 AM
Calculating tax rate per province in VB Cost Rate Table Macro Help JohnTurner Project 1 01-27-2014 07:53 AM
Help: Very low response-rate! Jeff10 Office 6 12-17-2013 10:44 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:26 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft