Home |
Search |
Today's Posts |
#1
|
|||
|
|||
radio button help
What I want is if the radio button (named "VolorInvol") is selected, it
performs the formula in the cell, if the radio button is not marked I want the cell to be blank. Here's my code but it doesn't work, what am I doing wrong? There are several other radio buttons in this same group so a checkbox won't work for this situation. Private Sub VolorInvol_Click() If VolorInvol.Value = True Then Range("B14").Formula = "=DATE(YEAR(EVENT),MONTH(EVENT)+1,0)" Else Range("B14").Value = "" End If End Sub |
#2
|
|||
|
|||
Hi
Did you not see my earlier reply? What you are doing wrong is that the event (macro) you have here will only run when the radio button VolorInvol is clicked. Clicking a radio button "turns is on" making its vba value True. Therefore you code can only ever enter the formula in B14. It will never remove the formula. You need to add the line of code: Range("B14").Value = "" to the click event for all the other buttons in order to remove the formula from B14 when VolorInvol is not checked. Regards Rowan tjb wrote: What I want is if the radio button (named "VolorInvol") is selected, it performs the formula in the cell, if the radio button is not marked I want the cell to be blank. Here's my code but it doesn't work, what am I doing wrong? There are several other radio buttons in this same group so a checkbox won't work for this situation. Private Sub VolorInvol_Click() If VolorInvol.Value = True Then Range("B14").Formula = "=DATE(YEAR(EVENT),MONTH(EVENT)+1,0)" Else Range("B14").Value = "" End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
radio button help | Excel Worksheet Functions | |||
"RADIO BUTTON" | Excel Discussion (Misc queries) | |||
How do I lock a radio button group if a N/A button is selected | Excel Discussion (Misc queries) | |||
how do I link radio button selection to another page | Excel Worksheet Functions | |||
VBA: Disable Frame and Radio Buttons based on Another Radio Button Being True | Excel Worksheet Functions |