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.
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:
I think it's "value" anyways, I'll revise this if my swiss cheese memory is playing games with me again :PCode: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
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!
Last edited by mewingkitty; 07-02-2009 at 03:09 AM.
=IF(AND(OR(BLONDE,BRUNETTE,REDHEAD),OR(MY PLACE,HER PLACE),ME),BOW-CHICKA-BOW-WOW,ANOTHER NIGHT ON THE INTERNET)
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?
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)
Shadow is set as false. Still get the shading when the button is clicked.
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)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks