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? 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
|
|||
|
|||
This doesn't work as a radio button will only ever be true when clicked.
It is set to false (off) when another radio button is clicked. One way to fix this would be to replace the radio button with a checkbox. Your code would work for a checkbox as is. Otherwise you would have to add code to the click event of all the other radio buttons on the sheet to remove the formula from B14. Hope this helps 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? 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" | 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 | |||
How do I set up a radio button on an Excell spreadsheet | Excel Discussion (Misc queries) | |||
VBA: Disable Frame and Radio Buttons based on Another Radio Button Being True | Excel Worksheet Functions |