Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 07-02-2009, 01:57 AM
zerodegreec zerodegreec is offline
Registered User
 
Join Date: 10 Jun 2009
Location: here
MS Office Version:Excel 2003
Posts: 26
zerodegreec is becoming part of the community
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.
Reply With Quote
  #2  
Old 07-02-2009, 02:04 AM
mewingkitty's Avatar
mewingkitty mewingkitty is offline
Valued Forum Contributor
 
Join Date: 29 Sep 2008
Location: Grande Prairie, Alberta, Canada
MS Office Version:Excel 2007
Posts: 902
mewingkitty has an addiction to Excel
Send a message via MSN to mewingkitty Send a message via Yahoo to mewingkitty
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.
Reply With Quote
  #3  
Old 07-02-2009, 09:15 PM
zerodegreec zerodegreec is offline
Registered User
 
Join Date: 10 Jun 2009
Location: here
MS Office Version:Excel 2003
Posts: 26
zerodegreec is becoming part of the community
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?
Reply With Quote
  #4  
Old 07-03-2009, 01:38 AM
mewingkitty's Avatar
mewingkitty mewingkitty is offline
Valued Forum Contributor
 
Join Date: 29 Sep 2008
Location: Grande Prairie, Alberta, Canada
MS Office Version:Excel 2007
Posts: 902
mewingkitty has an addiction to Excel
Send a message via MSN to mewingkitty Send a message via Yahoo to mewingkitty
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)
Reply With Quote
  #5  
Old 07-03-2009, 08:15 AM
zerodegreec zerodegreec is offline
Registered User
 
Join Date: 10 Jun 2009
Location: here
MS Office Version:Excel 2003
Posts: 26
zerodegreec is becoming part of the community
Re: Toggle Button text changes

Shadow is set as false. Still get the shading when the button is clicked.
Reply With Quote
  #6  
Old 07-04-2009, 01:34 PM
mewingkitty's Avatar
mewingkitty mewingkitty is offline
Valued Forum Contributor
 
Join Date: 29 Sep 2008
Location: Grande Prairie, Alberta, Canada
MS Office Version:Excel 2007
Posts: 902
mewingkitty has an addiction to Excel
Send a message via MSN to mewingkitty Send a message via Yahoo to mewingkitty
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)
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump