Check Boxes.. ?

rajivsoni

Board Regular
Joined
May 5, 2006
Messages
133
I have inserted a check box in SHeet1.
Now, when i tick the check box i want that it should display this formula in Cell B1 = C1*D1
and if i untick the check box it should display this
Cell B1 = F1 * G1.

is tht possible???
also it would be for the entire column.

Please Help me.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Using a Checkbox from the Controls ToolBox, I wouldn't use the whole Column though, but limit it to the amount of data available.

Option Explicit

Code:
Private Sub CheckBox1_Click()
    Dim cl     As Range
    Dim rng    As Range
    With Sheet1
        Set rng = Columns(2)
    End With
    For Each cl In rng
        If Me.CheckBox1.Value = True Then
            cl.FormulaR1C1 = "=RC[1]*RC[2]"
        Else: cl.FormulaR1C1 = "=RC[4]*RC[5]"
        End If
    Next cl
End Sub
 
Upvote 0
just read Joe's question, if you are considering a Checkbox for each row, i would simply have a value to check in another column & use an If statement.

So

=IF(A2="Y",C2*D2,F2*G2)
 
Upvote 0
but now i have a problem.... i have a huuuuuge formula to be followed how do i incorporate that out here??? :(
heres the formula
P10 = Date
F2 = (=Now())
IF($P10="","",IF($F$2>$P10,"LATE",IF(($F$2+7)>$P10,"1Wk",IF(($F$2+14)>$P10,"2Wk",IF(($F$2+21)>$P10,"3Wk",IF(($F$2+28)>$P10,"4Wk",IF(($F$2+35)>$P10,"5Wk","6WK")))))))
 
Upvote 0
I'm not completely familiar with check boxes in excel, but if they are anything like access try this code:

Code:
Private Sub CheckBox1_Click()

If (checkbox1.value = true) then
Cells(1,2).value = cells(1,3).value * Cells(1,4).value
Else
Cells(1,2).value = cells(1,6).value * Cells(1,7).value
End If

End Sub
 
Upvote 0
So your checkbox could try to multiply a formula "F2 = (=Now())" by the value of G2?

Probably gonna be a problem.
 
Upvote 0

Forum statistics

Threads
1,213,520
Messages
6,114,101
Members
448,548
Latest member
harryls

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top