Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Checkbox linked to calcs
Hi, I'm trying to link a checkbox to do specific calculations.
Assuming that it's possible, I have the following dilemma: When checkbox is checked, n=n-a, when unchecked, n. I wrote the following code but it doesn't work Dim withMobile As CheckBox If withMobile.Value = True Then Range("U66").Select ActiveCell.FormulaR1C1 = "=RC[60]+RC[90]+RC[102]+RC[114]+RC[126]-RC[108]" Selection.AutoFill Destination:=Range("U66:U99"), Type:=xlFillDefault Range("V66").Select ActiveCell.FormulaR1C1 = "=RC[60]+RC[90]+RC[102]+RC[114]+RC[126]-RC[108]" Selection.AutoFill Destination:=Range("V66:V99"), Type:=xlFillDefault Range("W66").Select ActiveCell.FormulaR1C1 = _ "=IF(FISCAL_YTD=""YES"",RC[-2]-RC[-1],IFERROR(RC[-2]-RC[-1],0))-RC[108]" Selection.AutoFill Destination:=Range("W66:W99"), Type:=xlFillDefault Range("L66").Select ActiveCell.FormulaR1C1 = "=RC[60]+RC[90]+RC[102]+RC[114]+RC[126]-RC[108]" Selection.AutoFill Destination:=Range("L66:L99"), Type:=xlFillDefault ElseIf withMobile.Value = False Then Range("U66").Select ActiveCell.FormulaR1C1 = "=RC[60]+RC[90]+RC[102]+RC[114]+RC[126]" Selection.AutoFill Destination:=Range("U66:U99"), Type:=xlFillDefault Range("V66").Select ActiveCell.FormulaR1C1 = "=RC[60]+RC[90]+RC[102]+RC[114]+RC[126]" Selection.AutoFill Destination:=Range("V66:V99"), Type:=xlFillDefault Range("W66").Select ActiveCell.FormulaR1C1 = _ "=IF(FISCAL_YTD=""YES"",RC[-2]-RC[-1],IFERROR(RC[-2]-RC[-1],0))" Selection.AutoFill Destination:=Range("W66:W99"), Type:=xlFillDefault Range("L66").Select ActiveCell.FormulaR1C1 = "=RC[60]+RC[90]+RC[102]+RC[114]+RC[126]" Selection.AutoFill Destination:=Range("L66:L99"), Type:=xlFillDefault End If End Sub Could anyone please help? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
font color with checkbox linked cel | Excel Discussion (Misc queries) | |||
CheckBox / Linked Cell Problem | Excel Programming | |||
Checkbox name linked to a cell | Excel Discussion (Misc queries) | |||
What are the calcs in PMT | Excel Worksheet Functions | |||
checkbox linked to a cell | Excel Programming |