+ Reply to Thread
Results 1 to 11 of 11

Reset All Toggle Buttons

  1. #1
    Registered User
    Join Date
    05-24-2013
    Location
    Hampshire
    MS-Off Ver
    Office 2013
    Posts
    49

    Reset All Toggle Buttons

    Hey Guys

    Done a general search and tried a few ways, however I have been unable to find exactly what I need. I have a user form with TOGGLE buttons Mar 14, Apr 14 etc...

    Mar 14 button has this vba code:

    Please Login or Register  to view this content.
    This hides columns when toggled ON, then shows them again when toggled OFF.

    What I would like, is say I have 4 toggle buttons on a ON state, I would like a regular command button called "RESET ALL" which will set the state of all toggle buttons in my userform to OFF.

    Is this possible?

    Kind regards and many thanks in advance!

    Ash
    Last edited by Ash_; 05-07-2014 at 09:37 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Reset All Toggle Buttons

    Please Login or Register  to view this content.
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    05-24-2013
    Location
    Hampshire
    MS-Off Ver
    Office 2013
    Posts
    49

    Re: Reset All Toggle Buttons

    Worked an absolute treat, thanks alot!!!!

  4. #4
    Registered User
    Join Date
    05-24-2013
    Location
    Hampshire
    MS-Off Ver
    Office 2013
    Posts
    49

    Re: Reset All Toggle Buttons

    Ohh one more question, is there a way that I can have that code automatically run when I change tabs? Ive tried the Worksheet active function but to no avail Thanks

  5. #5
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Reset All Toggle Buttons

    In thisworkbook

    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

    End Sub

  6. #6
    Registered User
    Join Date
    05-24-2013
    Location
    Hampshire
    MS-Off Ver
    Office 2013
    Posts
    49

    Re: Reset All Toggle Buttons

    Doesnt seem to work, it just stays the same when I flick through tabs.

  7. #7
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Reset All Toggle Buttons

    Is the code in the user forms?

  8. #8
    Registered User
    Join Date
    05-24-2013
    Location
    Hampshire
    MS-Off Ver
    Office 2013
    Posts
    49

    Re: Reset All Toggle Buttons

    Yes, and I have also tried it in the general Workbook code aswell

    In every Microsoft Excel Objects > Sheet(1/2/3)

    I have MyUserFormName.Show so that everytime I change, it opens it up again.

    I have tried MyUserFormName.Hide and .Show but that doesnt work either

  9. #9
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Reset All Toggle Buttons

    sorry


    Private Sub Workbook_SheetActivate(ByVal Sh As Object)

  10. #10
    Registered User
    Join Date
    05-24-2013
    Location
    Hampshire
    MS-Off Ver
    Office 2013
    Posts
    49

    Re: Reset All Toggle Buttons

    Do appriciate your help!

    Every time I change tabs now, I get an Compile Rror: Method or data member not found.

    Cheers for all your help so far by the way!

    EDIT: Sorted it, changed me.controls to MyFormName.controls

    Thank you so much for your help!
    Last edited by Ash_; 05-07-2014 at 09:27 AM.

  11. #11
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Reset All Toggle Buttons

    no probs, glad to share the knowledge :o)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Filtering Using Toggle Buttons
    By Farmall in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-20-2012, 04:32 PM
  2. [SOLVED] form with Toggle Buttons
    By Bill in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-16-2006, 01:50 PM
  3. [SOLVED] Toggle command buttons
    By GEB in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-23-2005, 04:05 PM
  4. Toggle Buttons
    By Momo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-09-2005, 10:06 AM
  5. How do I use Toggle Buttons?
    By fuzzyfreak in forum Excel General
    Replies: 0
    Last Post: 01-21-2005, 01:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1