LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
MK MK is offline
external usenet poster
 
Posts: 57
Default Checkbox linked to calcs

Hi, I'm trying to use a checkbox to either include a certain data point or
exclude it. If checkbox is checked, n=n-a, if checkbox is unchecked, n.

I tried running the following code, but it doesn't work. Can someone please
help?

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

Thank you,

MK
 
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
Checkbox linked to calcs MK Excel Programming 0 March 1st 10 09:54 AM
font color with checkbox linked cel Robbie Doo Excel Discussion (Misc queries) 0 January 28th 10 05:13 PM
CheckBox / Linked Cell Problem Joyce Excel Programming 17 September 28th 09 01:47 PM
Checkbox name linked to a cell Tdp Excel Discussion (Misc queries) 5 October 23rd 08 04:33 PM
checkbox linked to a cell Greg[_34_] Excel Programming 1 November 8th 06 10:02 PM


All times are GMT +1. The time now is 06:15 AM.

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

About Us

"It's about Microsoft Excel"