Forum Statistics
- Forum Members:
- Total Threads:
- Total Posts: 6
There are 1 users currently browsing forums.
|
 |

07-02-2009, 01:57 AM
|
|
Registered User
|
|
Join Date: 10 Jun 2009
Location: here
MS Office Version:Excel 2003
Posts: 26
|
|
|
Toggle Button text changes
Please Register to Remove these Ads
I am trying to setup a Toggle button to change its "caption" when enabled disabled. I have the true false linked to Cell T2 and have the cells I need to change all setup to work with cell T2 cycling between true/false.
What I would like to happen is when the button is clicked the caption changes and if possible the background colour change.
My initial thought was to use the linked cell (T2) in the buttons VBA code to satisfy a If statement. But I dont know how to put this into practice.
(BTW I enjoy learning how to code works more than just having someone post a bit of code.)
Thanks.
|

07-02-2009, 02:04 AM
|
 |
Valued Forum Contributor
|
|
Join Date: 29 Sep 2008
Location: Grande Prairie, Alberta, Canada
MS Office Version:Excel 2007
Posts: 902
|
|
|
Re: Toggle Button text changes
I've done this before, once you figure out the true/false part of it it's easy.
throw in something along the lines of:
Code:
if togglebutton1.value = false then
togglebutton1.caption = "This button is turned off"
endif
if togglebutton1.value = true then
togglebutton1.caption = "mew mew mew mew mew"
endif
I think it's "value" anyways, I'll revise this if my swiss cheese memory is playing games with me again :P
edit
Yay, I remembered something 
So yeah, now that you know about that part, you should be able to see how to have the button modify itself through the names in the properties screen for that button, you can change anything about it (or anything else for that matter) in that fashion.
I use this for search engines and record keeping workbooks. I try to cut down on cluttered screens by having a button which for example... has the screen set to record a new entry, and says "Currently set to record entries, click to look up old entries", then clicking it changes itself, and some of the rest of the sheet to a lookup format instead of an entry one.
hope that helps.
mew!
__________________
=IF(AND(OR(BLONDE,BRUNETTE,REDHEAD),OR(MY PLACE,HER PLACE),ME),BOW-CHICKA-BOW-WOW,ANOTHER NIGHT ON THE INTERNET)
Last edited by mewingkitty; 07-02-2009 at 02:09 AM.
|

07-02-2009, 09:15 PM
|
|
Registered User
|
|
Join Date: 10 Jun 2009
Location: here
MS Office Version:Excel 2003
Posts: 26
|
|
|
Re: Toggle Button text changes
Thanks for the reply. I was able to change the colors and the rest of the properties.
Any way of getting rid of the shading when the button has been changed from true to false?
|

07-03-2009, 01:38 AM
|
 |
Valued Forum Contributor
|
|
Join Date: 29 Sep 2008
Location: Grande Prairie, Alberta, Canada
MS Office Version:Excel 2007
Posts: 902
|
|
|
Re: Toggle Button text changes
If you mean "shadow"
then yes
it's another property of the button.
togglebutton1.shadow = false
?
mew!
__________________
=IF(AND(OR(BLONDE,BRUNETTE,REDHEAD),OR(MY PLACE,HER PLACE),ME),BOW-CHICKA-BOW-WOW,ANOTHER NIGHT ON THE INTERNET)
|

07-03-2009, 08:15 AM
|
|
Registered User
|
|
Join Date: 10 Jun 2009
Location: here
MS Office Version:Excel 2003
Posts: 26
|
|
|
Re: Toggle Button text changes
Shadow is set as false. Still get the shading when the button is clicked.
|

07-04-2009, 01:34 PM
|
 |
Valued Forum Contributor
|
|
Join Date: 29 Sep 2008
Location: Grande Prairie, Alberta, Canada
MS Office Version:Excel 2007
Posts: 902
|
|
|
Re: Toggle Button text changes
can you post it? I'm not sure what we're trying to fix.
__________________
=IF(AND(OR(BLONDE,BRUNETTE,REDHEAD),OR(MY PLACE,HER PLACE),ME),BOW-CHICKA-BOW-WOW,ANOTHER NIGHT ON THE INTERNET)
|
 |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|