+ Reply to Thread
Results 1 to 4 of 4

SpinButtons Up/Down don't work in a module

  1. #1
    Registered User
    Join Date
    03-20-2019
    Location
    Saginaw, MI
    MS-Off Ver
    2010
    Posts
    2

    SpinButtons Up/Down don't work in a module

    I'm trying to have every sheet on my workbook, rows 3 through 25, hide if I click up on the SpinButton, and show if I click down on the SpinButton. But I want to be able to duplicate the spinbutton on each worksheet, while only having to write the code once, in a module. Is this possible?


    Right now it doesn't work at all when I put the code in a module or ThisWorkbook, unless I run it from the VB window... which I don't understand. It works when the code is in Sheet1, however.

    Here is my code:

    Please Login or Register  to view this content.

    Thanks!

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,176

    Re: SpinButtons Up/Down don't work in a module

    If you are wanting to have rows hidden or shown on any active sheet then try Userform option...
    This way you will only need one control...

    PS...Your code as is...Only hides active sheet and not every sheets rows...
    Please Login or Register  to view this content.
    To hide all sheets ....
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 03-29-2019 at 04:43 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    03-20-2019
    Location
    Saginaw, MI
    MS-Off Ver
    2010
    Posts
    2

    Re: SpinButtons Up/Down don't work in a module

    Thanks - that solved my issues. I avoided using a userform, because I didn't think my users would like dealing with a popup

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: SpinButtons Up/Down don't work in a module

    Hello zmdavis,

    ...I avoided using a userform, because I didn't think my users would like dealing with a popup
    Would this revised version of sintek's solution suit you better?

    Regards.
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

+ 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. Calling a Module doesnt work, but going through with F8 does
    By Mutzi in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-14-2018, 09:22 AM
  2. Modify VBA to work in a worksheet module
    By aquixano in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2018, 12:36 PM
  3. [SOLVED] how to reset a spinbuttons value
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2017, 04:03 PM
  4. spinbuttons to show/hide sets of rows
    By michelleblanc in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-22-2016, 05:46 PM
  5. how to access Sheet module, normal module, Worbook module to type code
    By alibaba in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2009, 07:51 AM
  6. putting spinbuttons in a worksheet
    By Justme47 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-14-2008, 05:31 PM
  7. How do you define SpinButtons??
    By Skyhouse71 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-10-2005, 11:06 AM

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