Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

if statement based on Shapes.Value

  Asked By: Darla    Date: Jan 31    Category: MS Office    Views: 1331
  

I have four buttons on a single worksheet. I need to know which
button
is enabled because some values are based on these buttons.

The following fails:
If ActiveSheet.Shapes("Option Button 1").Value = xlOn Then
CS_Flag
= True
If ActiveSheet.Shapes("Option Button 2").Value = xlOn Then
RS_Flag
= True
If ActiveSheet.Shapes("Option Button 3").Value = xlOn Then
EX_Flag
= True
If ActiveSheet.Shapes("Option Button 4").Value = xlOn Then
UnHide_Flag = True

Does anyone know the code to use that I might use an if statement on
the shape value? Once this is coded, I already know how to change
the
names to more meaniful values.

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Frances Parker     Answered On: Jan 31

You're saying "button"..
Are you saying that you've placed actual buttons  on the sheet?
the button  itself should have a click event that you can use to set a global
variable.
Also, look at the "focus" methods.

I'll look into it also.

 
Answer #2    Answered By: Adalgisa Fischer     Answered On: Jan 31

I think you will find it easier if you use the radio buttons  from the control
toolbar instead of the one from the forms toolbar. These expose their
properties in the VBE.

 
Didn't find what you were looking for? Find more on if statement based on Shapes.Value Or get search suggestion and latest updates.




Tagged: