Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 390
Default Toggle Buttons

I have a form with 10 toggle buttons. Each toggle button uses the same code.
How can I change the code so that is uses one piece of code instead on ten
sets of code.

Private Sub ToggleButton11_Click()
If ToggleButton11.Value = True Then
ToggleButton11.Caption = " "
ToggleButton11.BackColor = RGB(0, 255, 0)
Else
ToggleButton11.Caption = " "
ToggleButton11.BackColor = RGB(255, 0, 0)
End If
End Sub

Thanks Bill
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Toggle Buttons

Use the same method as shown here
http://www.j-walk.com/ss/excel/tips/tip44.htm

for handling multiple commandbuttons.

--
Regards,
Tom Ogilvy


"Bill" wrote:

I have a form with 10 toggle buttons. Each toggle button uses the same code.
How can I change the code so that is uses one piece of code instead on ten
sets of code.

Private Sub ToggleButton11_Click()
If ToggleButton11.Value = True Then
ToggleButton11.Caption = " "
ToggleButton11.BackColor = RGB(0, 255, 0)
Else
ToggleButton11.Caption = " "
ToggleButton11.BackColor = RGB(255, 0, 0)
End If
End Sub

Thanks Bill

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
have toggle buttons but everytime print preview buttons move TinSandhu Excel Discussion (Misc queries) 1 October 11th 06 02:57 PM
Toggle command buttons GEB Excel Programming 4 June 23rd 05 08:33 PM
Colouring Stuff, Toggle Buttons Momo Excel Programming 2 February 9th 05 03:19 PM
Toggle Buttons Momo Excel Programming 2 February 9th 05 01:35 PM
multiple toggle buttons Nelson Excel Programming 3 November 2nd 04 08:27 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"