radio button help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top