Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,069
Default ActiveX ToggleButton Reset

I have a sheet with several hundred ActiveX Toggle buttons. After running
some code, I need to reset them all so their value = False. Is there a way to
do with with out typing out ToggleButtonX.Value = False 300+ times?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default ActiveX ToggleButton Reset

You could use a macro like:

Option Explicit
Sub testme02()
Dim OLEObj As OLEObject
Dim wks As Worksheet

Set wks = Worksheets("Sheet1")

For Each OLEObj In wks.OLEObjects
If TypeOf OLEObj.Object Is msforms.ToggleButton Then
OLEObj.Object.Value = False
End If
Next OLEObj

End Sub


John wrote:

I have a sheet with several hundred ActiveX Toggle buttons. After running
some code, I need to reset them all so their value = False. Is there a way to
do with with out typing out ToggleButtonX.Value = False 300+ times?

Thanks!


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default ActiveX ToggleButton Reset

Try some code like


Sub ResetToggles()
Dim WS As Worksheet
Dim OleObj As OLEObject
Set WS = Worksheets("Sheet2")
For Each OleObj In WS.OLEObjects
If TypeOf OleObj.Object Is MSForms.ToggleButton Then
OleObj.Object.Value = False
End If
Next OleObj
End Sub

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




On Wed, 13 May 2009 12:14:39 -0700, John
wrote:

I have a sheet with several hundred ActiveX Toggle buttons. After running
some code, I need to reset them all so their value = False. Is there a way to
do with with out typing out ToggleButtonX.Value = False 300+ times?

Thanks!

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
ActiveX Medley1208 Excel Discussion (Misc queries) 0 May 30th 08 05:09 PM
Help with togglebutton that displays jpg caj Excel Discussion (Misc queries) 2 March 7th 07 03:44 PM
Need ActiveX hierarchy. Sreekar Excel Discussion (Misc queries) 0 November 13th 06 10:34 PM
ActiveX Controls Charly Excel Discussion (Misc queries) 1 October 18th 06 02:53 PM
ActiveX RedChequer Excel Discussion (Misc queries) 0 March 10th 05 12:05 AM


All times are GMT +1. The time now is 12:59 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"