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 |
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 |
All times are GMT +1. The time now is 04:13 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com