Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assigning a Macro to Checkbox on a worksheet
I am having difficulty assigning a small macro to a checkbox i have on a sheet.
I right click on the checkbox to assign a macro and have this : Sub checkbox10_click() End Sub I simply want a basic ocurance such as: If the checkbox is TICKED then Range("C32").value = "Hello" and Range("C33").value = "Goodbye" Else if the Checkbox is NOT TICKED then both C32 and C33 to be empty (="") I cannot get the correct syntax for the checkbox?? Corey.... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assigning a Macro to Checkbox on a worksheet
hi
try this..... Private Sub CheckBox1_Click() If CheckBox1.Value = True Then Range("C32").Value = "Hello" Range("C33").Value = "Goodbye" Else Range("C32").Value = "" Range("C33").Value = "" End If End Sub regards FSt1 "Corey" wrote: I am having difficulty assigning a small macro to a checkbox i have on a sheet. I right click on the checkbox to assign a macro and have this : Sub checkbox10_click() End Sub I simply want a basic ocurance such as: If the checkbox is TICKED then Range("C32").value = "Hello" and Range("C33").value = "Goodbye" Else if the Checkbox is NOT TICKED then both C32 and C33 to be empty (="") I cannot get the correct syntax for the checkbox?? Corey.... |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assigning a Macro to Checkbox on a worksheet
You don't tell us what checkbox contol you are using.
So if your using a forms control checkbox this should work Private Sub CheckBox1_Click() If [Check Box 1].Value 0 Then Range("C32").Value = "Hello" Range("C33").Value = "Goodbye" End If If [Check Box 1].Value < 0 Then Range("C32").Value = "" Range("C33").Value = "" End If End Sub "Corey" wrote: I am having difficulty assigning a small macro to a checkbox i have on a sheet. I right click on the checkbox to assign a macro and have this : Sub checkbox10_click() End Sub I simply want a basic ocurance such as: If the checkbox is TICKED then Range("C32").value = "Hello" and Range("C33").value = "Goodbye" Else if the Checkbox is NOT TICKED then both C32 and C33 to be empty (="") I cannot get the correct syntax for the checkbox?? Corey.... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Assigning a Worksheet Name to a Cell | Excel Worksheet Functions | |||
Assigning checkbox to the cell | Excel Programming | |||
assigning worksheet variable | Excel Programming | |||
Assigning a macro to a worksheet (vs personal.xls) | Excel Programming | |||
Assigning click event to OleObjects checkbox | Excel Programming |