Results 1 to 4 of 4

VBA buttons for hide/unhide rows disappear at random

Threaded View

  1. #1
    Registered User
    Join Date
    03-28-2013
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2010
    Posts
    16

    VBA buttons for hide/unhide rows disappear at random

    Hi -

    I have 5 buttons in my spreadsheet. Each of the 5 buttons expands/contracts a few rows below it. Each button has a separate macro to control it, since each button corresponds to a different set of rows. Here is the code I used (found from another thread). Unfortunately I can't attach the confidential document:

    Sub Packages()
    With Rows("42:50")
            .Select
           .EntireRow.Hidden = Not .EntireRow.Hidden
        End With
    End Sub
    After I click a couple of buttons in the spreadsheet, weird things start to happen. Some buttons will disappear, while others don't, and sometimes the button I'm pressing disappears. Other people have had similar problems and blame it on a bug in Excel 2010, although I haven't found a solution that works for me. It's likely that it is just a bug in Excel because the buttons appear/disappear at random in different patterns.

    Does anyone know of a viable workaround for this? One possibility I could imagine is code that tells the button to always remain visible? I am new to using macros, so I would be thankful for anything to point me in the right direction. Thanks!
    Last edited by derekopswat; 04-01-2013 at 12:31 PM. Reason: incorrect code

Thread Information

Users Browsing this Thread

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

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