ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Clearing Check Boxes & Running a diff Macro when unchecking the ch (https://www.excelbanter.com/excel-discussion-misc-queries/144550-clearing-check-boxes-running-diff-macro-when-unchecking-ch.html)

Vick

Clearing Check Boxes & Running a diff Macro when unchecking the ch
 
Ok, I'm using the Control check boxes. I have 6 of them. On each of the 6 I
have assigned a Macro to do something on the page. I have 2 problems.

1)I want to make so that only one box can be selected (Not sure if there is
a way to do that or have a macro to clear the rest of the check boxes)

2) I want two different actions when the box is unchecked. Right now the
macro runs when I check or uncheck the box. I would like one macro to run
when I check the box and one to run when I uncheck the box. Is there a way to
accomplish this?

Thanks

Vick

Clearing Check Boxes & Running a diff Macro when unchecking the ch
 
I was looking at it and a combo box might be easier, but I have no idea how
it works. How do I get my values in the drop down box? Also, can I have a
macro run for each of the selections in the drop down box? I'm open to new
ideas, whatever is easiest is fine with me.

Thanks Again

"Vick" wrote:

Ok, I'm using the Control check boxes. I have 6 of them. On each of the 6 I
have assigned a Macro to do something on the page. I have 2 problems.

1)I want to make so that only one box can be selected (Not sure if there is
a way to do that or have a macro to clear the rest of the check boxes)

2) I want two different actions when the box is unchecked. Right now the
macro runs when I check or uncheck the box. I would like one macro to run
when I check the box and one to run when I uncheck the box. Is there a way to
accomplish this?

Thanks


FSt1

Clearing Check Boxes & Running a diff Macro when unchecking the ch
 
hi
in each checkbox you will need code like this.
Private Sub CheckBox1_Click()
If CheckBox1 = True Then
CheckBox2 = False 'all the others = false
CheckBox3 = False
'Call macro1 'call a specific macro for this checkbox
End If
End Sub
I only did 3 check boxes to test but you will need to list all of them as =
false.
each check box needs code that if checked(=true) then uncheck(=false) all
the rest then call the specific macro for that check box.
make sence?

post back if confused.
Regards
FSt1

"Vick" wrote:

Ok, I'm using the Control check boxes. I have 6 of them. On each of the 6 I
have assigned a Macro to do something on the page. I have 2 problems.

1)I want to make so that only one box can be selected (Not sure if there is
a way to do that or have a macro to clear the rest of the check boxes)

2) I want two different actions when the box is unchecked. Right now the
macro runs when I check or uncheck the box. I would like one macro to run
when I check the box and one to run when I uncheck the box. Is there a way to
accomplish this?

Thanks


Dave Peterson

Clearing Check Boxes & Running a diff Macro when unchecking the ch
 
If you think that a combobox would be easier, you may find that Data|Validation
is even easier. It looks kind of the same and behaves kind of the same, but is
lots easier to implement (and lots easier to break!).

Debra Dalgleish has lots of tips:
http://contextures.com/xlDataVal01.html

Vick wrote:

I was looking at it and a combo box might be easier, but I have no idea how
it works. How do I get my values in the drop down box? Also, can I have a
macro run for each of the selections in the drop down box? I'm open to new
ideas, whatever is easiest is fine with me.

Thanks Again

"Vick" wrote:

Ok, I'm using the Control check boxes. I have 6 of them. On each of the 6 I
have assigned a Macro to do something on the page. I have 2 problems.

1)I want to make so that only one box can be selected (Not sure if there is
a way to do that or have a macro to clear the rest of the check boxes)

2) I want two different actions when the box is unchecked. Right now the
macro runs when I check or uncheck the box. I would like one macro to run
when I check the box and one to run when I uncheck the box. Is there a way to
accomplish this?

Thanks


--

Dave Peterson

Peo Sjoblom

Clearing Check Boxes & Running a diff Macro when unchecking the ch
 
And a lot harder to read from the dropdown especially if you have a 75% zoom


--
Regards,

Peo Sjoblom


"Dave Peterson" wrote in message
...
If you think that a combobox would be easier, you may find that
Data|Validation
is even easier. It looks kind of the same and behaves kind of the same,
but is
lots easier to implement (and lots easier to break!).

Debra Dalgleish has lots of tips:
http://contextures.com/xlDataVal01.html

Vick wrote:

I was looking at it and a combo box might be easier, but I have no idea
how
it works. How do I get my values in the drop down box? Also, can I have a
macro run for each of the selections in the drop down box? I'm open to
new
ideas, whatever is easiest is fine with me.

Thanks Again

"Vick" wrote:

Ok, I'm using the Control check boxes. I have 6 of them. On each of
the 6 I
have assigned a Macro to do something on the page. I have 2 problems.

1)I want to make so that only one box can be selected (Not sure if
there is
a way to do that or have a macro to clear the rest of the check boxes)

2) I want two different actions when the box is unchecked. Right now
the
macro runs when I check or uncheck the box. I would like one macro to
run
when I check the box and one to run when I uncheck the box. Is there a
way to
accomplish this?

Thanks


--

Dave Peterson




Vick

Clearing Check Boxes & Running a diff Macro when unchecking th
 
Can you use an if statement in data validation? For example my list is in a
named range called TS, my data validation is in a2, my lookup value is in A1.
So if A1=TS, then it would pull up the TS List, I have 4 options in A1 this
is just one example?

"Dave Peterson" wrote:

If you think that a combobox would be easier, you may find that Data|Validation
is even easier. It looks kind of the same and behaves kind of the same, but is
lots easier to implement (and lots easier to break!).

Debra Dalgleish has lots of tips:
http://contextures.com/xlDataVal01.html

Vick wrote:

I was looking at it and a combo box might be easier, but I have no idea how
it works. How do I get my values in the drop down box? Also, can I have a
macro run for each of the selections in the drop down box? I'm open to new
ideas, whatever is easiest is fine with me.

Thanks Again

"Vick" wrote:

Ok, I'm using the Control check boxes. I have 6 of them. On each of the 6 I
have assigned a Macro to do something on the page. I have 2 problems.

1)I want to make so that only one box can be selected (Not sure if there is
a way to do that or have a macro to clear the rest of the check boxes)

2) I want two different actions when the box is unchecked. Right now the
macro runs when I check or uncheck the box. I would like one macro to run
when I check the box and one to run when I uncheck the box. Is there a way to
accomplish this?

Thanks


--

Dave Peterson


Dave Peterson

Clearing Check Boxes & Running a diff Macro when unchecking th
 
So you want a dependent list?

See Debra's site again!
http://contextures.com/xlDataVal02.html

Vick wrote:

Can you use an if statement in data validation? For example my list is in a
named range called TS, my data validation is in a2, my lookup value is in A1.
So if A1=TS, then it would pull up the TS List, I have 4 options in A1 this
is just one example?

"Dave Peterson" wrote:

If you think that a combobox would be easier, you may find that Data|Validation
is even easier. It looks kind of the same and behaves kind of the same, but is
lots easier to implement (and lots easier to break!).

Debra Dalgleish has lots of tips:
http://contextures.com/xlDataVal01.html

Vick wrote:

I was looking at it and a combo box might be easier, but I have no idea how
it works. How do I get my values in the drop down box? Also, can I have a
macro run for each of the selections in the drop down box? I'm open to new
ideas, whatever is easiest is fine with me.

Thanks Again

"Vick" wrote:

Ok, I'm using the Control check boxes. I have 6 of them. On each of the 6 I
have assigned a Macro to do something on the page. I have 2 problems.

1)I want to make so that only one box can be selected (Not sure if there is
a way to do that or have a macro to clear the rest of the check boxes)

2) I want two different actions when the box is unchecked. Right now the
macro runs when I check or uncheck the box. I would like one macro to run
when I check the box and one to run when I uncheck the box. Is there a way to
accomplish this?

Thanks


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 04:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com