Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default Checkbox and inputing answer into a specific cell

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Checkbox and inputing answer into a specific cell

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I get a macro to populate the answer into one specific cel Matt Excel Discussion (Misc queries) 3 March 17th 09 08:49 PM
Not allowing to continu unless a specific cell has specific answer madubois9 Excel Discussion (Misc queries) 3 October 25th 07 12:45 AM
Link from a specific Cell in Excel to a specific para. in Word CathyK Excel Worksheet Functions 0 August 10th 06 04:40 PM
matching values and inputing value in the adjacent cell bundyloco[_3_] Excel Programming 1 July 17th 05 08:47 AM
How do I Paste thie answer into specific cell using vb...tia sal No Name Excel Programming 1 June 8th 05 03:30 PM


All times are GMT +1. The time now is 07:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"