PC Review


Reply
Thread Tools Rate Thread

Changing a cell from another cell's formula

 
 
magmike
Guest
Posts: n/a
 
      17th Nov 2011
I am using Excel 2007. I am using four different radio buttons which
all link to cell L29, creating the values 0-4, depending on which is
checked. The default is that none of them are checked.

If I change the value of L29 to 0, then all of the radio buttons will
be unchecked, even if one of them was checked before I changed the
value.

I would like to be able to change the value of L29 to 0, when the
value of a different cell (L18) reads FALSE, so that the radio buttons
are reset. However, if I put the formula in L29, it is overwritten
anytime a radio button change is made. I do not want to use a reset
button - I need the value of L18 in effect to become the reset
trigger.

Any ideas?

Thanks in advance!

magmike

 
Reply With Quote
 
 
 
 
magmike
Guest
Posts: n/a
 
      17th Nov 2011
On Nov 16, 11:57*pm, magmike <magmi...@yahoo.com> wrote:
> I am using Excel 2007. I am using four different radio buttons which
> all link to cell L29, creating the values 0-4, depending on which is
> checked. The default is that none of them are checked.
>
> If I change the value of L29 to 0, then all of the radio buttons will
> be unchecked, even if one of them was checked before I changed the
> value.
>
> I would like to be able to change the value of L29 to 0, when the
> value of a different cell (L18) reads FALSE, so that the radio buttons
> are reset. However, if I put the formula in L29, it is overwritten
> anytime a radio button change is made. I do not want to use a reset
> button - I need the value of L18 in effect to become the reset
> trigger.
>
> Any ideas?
>
> Thanks in advance!
>
> magmike


PS - I don't mind using VB, but if there is a way to do in a cell
formula somewhere, that would be preferable to having to save as a
Macro-Enabled excel document.

Thanks,
magmike
 
Reply With Quote
 
Auric__
Guest
Posts: n/a
 
      17th Nov 2011
magmike wrote:

> On Nov 16, 11:57*pm, magmike <magmi...@yahoo.com> wrote:
>> I am using Excel 2007. I am using four different radio buttons which
>> all link to cell L29, creating the values 0-4, depending on which is
>> checked. The default is that none of them are checked.
>>
>> If I change the value of L29 to 0, then all of the radio buttons will
>> be unchecked, even if one of them was checked before I changed the
>> value.
>>
>> I would like to be able to change the value of L29 to 0, when the
>> value of a different cell (L18) reads FALSE, so that the radio buttons
>> are reset. However, if I put the formula in L29, it is overwritten
>> anytime a radio button change is made. I do not want to use a reset
>> button - I need the value of L18 in effect to become the reset
>> trigger.
>>
>> Any ideas?
>>
>> Thanks in advance!
>>
>> magmike

>
> PS - I don't mind using VB, but if there is a way to do in a cell
> formula somewhere, that would be preferable to having to save as a
> Macro-Enabled excel document.


I'm pretty sure that clearing the radio buttons cannot be done this way
*without* scipting it. (Also, are you sure it's radio (a.k.a. option)
buttons? I rather think checkboxes would be better if they need to be all
clear, or more than one turned on at the same time.)

Anyway, you can try something like this. Drop this into the sheet's class (in
the VBA editor):

Private Sub Worksheet_Change(ByVal Target As Range)
If "$L$18" = Target.Address Then
If Target.Value = False Then
Range("L29").Value = 0
button1.Value = False
button2.Value = False
button3.Value = False
button4.Value = False
End If
End If
End Sub

You'll need to change the names of the button placeholders, of course.

(Caveat: I'm using Excel 2000. Test before using "for real".)

--
This hurts my brain.
 
Reply With Quote
 
magmike
Guest
Posts: n/a
 
      1st Dec 2011
On Nov 17, 11:13*am, "Auric__" <not.my.r...@email.address> wrote:
> magmikewrote:
> > On Nov 16, 11:57*pm,magmike<magmi...@yahoo.com> wrote:
> >> I am using Excel 2007. I am using four different radio buttons which
> >> all link to cell L29, creating the values 0-4, depending on which is
> >> checked. The default is that none of them are checked.

>
> >> If I change the value of L29 to 0, then all of the radio buttons will
> >> be unchecked, even if one of them was checked before I changed the
> >> value.

>
> >> I would like to be able to change the value of L29 to 0, when the
> >> value of a different cell (L18) reads FALSE, so that the radio buttons
> >> are reset. However, if I put the formula in L29, it is overwritten
> >> anytime a radio button change is made. I do not want to use a reset
> >> button - I need the value of L18 in effect to become the reset
> >> trigger.

>
> >> Any ideas?

>
> >> Thanks in advance!

>
> >>magmike

>
> > PS - I don't mind using VB, but if there is a way to do in a cell
> > formula somewhere, that would be preferable to having to save as a
> > Macro-Enabled excel document.

>
> I'm pretty sure that clearing the radio buttons cannot be done this way
> *without* scipting it. (Also, are you sure it's radio (a.k.a. option)
> buttons? I rather think checkboxes would be better if they need to be all
> clear, or more than one turned on at the same time.)
>
> Anyway, you can try something like this. Drop this into the sheet's class(in
> the VBA editor):
>
> * * Private Sub Worksheet_Change(ByVal Target As Range)
> * * * * If "$L$18" = Target.Address Then
> * * * * * * If Target.Value = False Then
> * * * * * * * * Range("L29").Value = 0
> * * * * * * * * button1.Value = False
> * * * * * * * * button2.Value = False
> * * * * * * * * button3.Value = False
> * * * * * * * * button4.Value = False
> * * * * * * End If
> * * * * End If
> * * End Sub
>
> You'll need to change the names of the button placeholders, of course.
>
> (Caveat: I'm using Excel 2000. Test before using "for real".)
>
> --
> This hurts my brain.- Hide quoted text -
>
> - Show quoted text -


I'm not getting this to work. First thing I should mention, however,
is that I have switched from using radio/option buttons, and using
drop downs. Would this change the code?

 
Reply With Quote
 
GS
Guest
Posts: n/a
 
      1st Dec 2011
on 11/30/2011, magmike supposed :
> On Nov 17, 11:13*am, "Auric__" <not.my.r...@email.address> wrote:
>> magmikewrote:
>>> On Nov 16, 11:57*pm,magmike<magmi...@yahoo.com> wrote:
>>>> I am using Excel 2007. I am using four different radio buttons which
>>>> all link to cell L29, creating the values 0-4, depending on which is
>>>> checked. The default is that none of them are checked.
>>>> If I change the value of L29 to 0, then all of the radio buttons will
>>>> be unchecked, even if one of them was checked before I changed the
>>>> value.

>>
>>>> I would like to be able to change the value of L29 to 0, when the
>>>> value of a different cell (L18) reads FALSE, so that the radio buttons
>>>> are reset. However, if I put the formula in L29, it is overwritten
>>>> anytime a radio button change is made. I do not want to use a reset
>>>> button - I need the value of L18 in effect to become the reset
>>>> trigger.

>>
>>>> Any ideas?

>>
>>>> Thanks in advance!

>>
>>>> magmike

>>
>>> PS - I don't mind using VB, but if there is a way to do in a cell
>>> formula somewhere, that would be preferable to having to save as a
>>> Macro-Enabled excel document.

>>
>> I'm pretty sure that clearing the radio buttons cannot be done this way
>> *without* scipting it. (Also, are you sure it's radio (a.k.a. option)
>> buttons? I rather think checkboxes would be better if they need to be all
>> clear, or more than one turned on at the same time.)
>>
>> Anyway, you can try something like this. Drop this into the sheet's class
>> (in the VBA editor):
>>
>> * * Private Sub Worksheet_Change(ByVal Target As Range)
>> * * * * If "$L$18" = Target.Address Then
>> * * * * * * If Target.Value = False Then
>> * * * * * * * * Range("L29").Value = 0
>> * * * * * * * * button1.Value = False
>> * * * * * * * * button2.Value = False
>> * * * * * * * * button3.Value = False
>> * * * * * * * * button4.Value = False
>> * * * * * * End If
>> * * * * End If
>> * * End Sub
>>
>> You'll need to change the names of the button placeholders, of course.
>>
>> (Caveat: I'm using Excel 2000. Test before using "for real".)
>>
>> --
>> This hurts my brain.- Hide quoted text -
>>
>> - Show quoted text -

>
> I'm not getting this to work. First thing I should mention, however,
> is that I have switched from using radio/option buttons, and using
> drop downs. Would this change the code?


Are these cell dropdowns (ie: a DataValidation list) or controls? If DV
dropdowns then where are they (cell address) and what is the criteria
if the chosen value is a specific value.

BTW, you state there WERE 4 option buttons ranging from 0 to 4 (total
of 5 options).-a bit confusing!

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:12 PM.