Checkbox and inputing answer into a specific cell

G

Guest

I hope you guys can help me out

I have a checkbox that included the tax with the orinigal price if the
checkbox is checked or =True. I have the checkbox code written in the sheet.
I have the tax code written in module "Mod1"

I am having trouble in getting it work. When i compile it now i get an
compile error stating "Expected Function or Variable". Which i dont understand


What is wrong in my code.

Here is the code for the checkbox.
Public Sub CheckBox41_Click()
Dim CheckBoxVT As Variant
CheckBoxVT = CheckBox41.Value
Application.Run(Mod1.Tax)
End Sub

Here is the Tax code located in Module "Mod1"
Option Explicit
Public Sub Tax()
Dim StateTax As Range
Dim CountyTax As Range
Dim VM As Range
Dim OP As Range
Dim VC As Variant
Dim VS As Variant
Dim OC As Variant
Dim OS As Variant
Dim TST As Variant
Dim TCT As Variant
Dim CheckBoxVT As Variant
Dim CheckBoxOT As Variant

Set StateTax = Worksheets("BID RECAP SUMMARY").Range("E37")
Set CountyTax = Worksheets("BID RECAP SUMMARY").Range("E38")
Set VM = Worksheets("BID RECAP SUMMARY").Range("I18")
Set OP = Worksheets("BID RECAP SUMMARY").Range("I33")

Select Case CheckBoxVT
Case Is = True
VS = StateTax * VM
VC = CountyTax * VM
Case Is = False
VS = 0
VC = 0
End Select

Select Case CheckBoxOT
Case Is = True
OS = StateTax * OP
OC = CountyTax * OP
Case Is = False
OS = 0
OC = 0
End Select

TST = VS + OS
TCT = VC + OC

Worksheets("BID RECAP SUMMARY").Range("g37").Value = TST
Worksheets("BID RECAP SUMMARY").Range("g38").Value = TCT

End Sub


Thanks in advance for the help guys!!

Andy
 
K

Ken Johnson

Hi Andy,
I think the problem is created by Application.Run(Mod1.Tax)
What happens if you just change that whole line to Tax
Ken Johnson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top