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?

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

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
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" 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
How do I set up a radio button on an Excell spreadsheet Mikel Excel Discussion (Misc queries) 1 April 7th 05 03:57 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 08:37 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"