Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
tjb
 
Posts: n/a
Default 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   Report Post  
Rowan
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
radio button help tjb Excel Worksheet Functions 1 September 27th 05 01:16 AM
"RADIO BUTTON" Ian Shere Excel Discussion (Misc queries) 1 July 4th 05 10:59 PM
How do I lock a radio button group if a N/A button is selected worry a lot Excel Discussion (Misc queries) 2 May 21st 05 08:33 PM
how do I link radio button selection to another page Sharon Excel Worksheet Functions 0 April 27th 05 09:29 PM
VBA: Disable Frame and Radio Buttons based on Another Radio Button Being True Mcasteel Excel Worksheet Functions 2 October 29th 04 07:06 PM


All times are GMT +1. The time now is 06:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"