Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
if a checkbox is checked then...
I am trying to write a code that will allow me to multiple one range by .15
- IF THE CHECKBOX IS CHECKED - and place the sum in another range. If not checked then it will equal 0 If chkEligable.Value = True Then Range ("Retirement") will equal .15 times Range ("Annual_Salary") Else Range("Retirement").Value = 0 Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
if a checkbox is checked then...
I assume the checkbox is on a sheet. Richt click on
the sheet tab and click "View Code" to open the sheet code module. Then copy and past the code into the code window. Also assumed you named the checkbox as shown. Private Sub chkEligable_Click() If chkEligable.Value = True Then Range("Retirement") = 0.15*Range("Annual_Salary").Value Else Range("Retirement") = 0 End Sub "tkw" wrote in message ... I am trying to write a code that will allow me to multiple one range by .15 - IF THE CHECKBOX IS CHECKED - and place the sum in another range. If not checked then it will equal 0 If chkEligable.Value = True Then Range ("Retirement") will equal .15 times Range ("Annual_Salary") Else Range("Retirement").Value = 0 Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
if a checkbox is checked then...
with worksheets("Somesheetname")
If chkEligable.Value = True Then .Range("Retirement").value = 0.15 * .Range("Annual_Salary").value else .range("Retirement").value = 0 end if end with I assumed that both the ranges are on the same sheet (named somesheetname). And this doesn't check for any non-numerical data, either. tkw wrote: I am trying to write a code that will allow me to multiple one range by .15 - IF THE CHECKBOX IS CHECKED - and place the sum in another range. If not checked then it will equal 0 If chkEligable.Value = True Then Range ("Retirement") will equal .15 times Range ("Annual_Salary") Else Range("Retirement").Value = 0 Thanks -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
IF checkbox is checked/unchecked, Cell.value = yes/no | Excel Worksheet Functions | |||
How to have Checkbox A uncheck with checked Checkbox B | Excel Discussion (Misc queries) | |||
Is checkbox is checked? | Excel Discussion (Misc queries) | |||
If Checkbox checked/notchecked then | Excel Programming | |||
checkbox - default checked or un-checked | Excel Programming |