+ Reply to Thread
Results 1 to 6 of 6

Problems hiding cells

  1. #1
    Registered User
    Join Date
    01-07-2011
    Location
    Trondheim, Norway
    MS-Off Ver
    MS Excel 2013, Norwegian version
    Posts
    16

    Question Problems hiding cells

    Hi,

    I have posted this question in some other forums, but no one knows whats wrong (even though many have replied). Hopefully someone here knows whats wrong!
    I use the following code for hiding some rows:

    Please Login or Register  to view this content.
    Then I receive this error:
    2h6d0zt.jpg
    The error says: "Can not set Hidden-property to the range class" (freely translated).

    FTR: I'm using Office 2010.

    Can anyone help me with this?

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Problems hiding cells

    I removed the With ActiveSheet.Buttons section and it worked fine for me. You issue has something to do with that.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    01-13-2013
    Location
    Oklahoma
    MS-Off Ver
    Office 2007 / Office 2010
    Posts
    123

    Re: Problems hiding cells

    It all runs fine for me. It makes the button small and hides rows 59 thru 499. it doesn't seem to hide all of the other rows though. Do you have anything going on in the worksheet module?

  4. #4
    Registered User
    Join Date
    01-07-2011
    Location
    Trondheim, Norway
    MS-Off Ver
    MS Excel 2013, Norwegian version
    Posts
    16

    Re: Problems hiding cells

    Quote Originally Posted by stnkynts View Post
    I removed the With ActiveSheet.Buttons section and it worked fine for me. You issue has something to do with that.

    Please Login or Register  to view this content.
    Hi stnkynts,

    Thank you for the reply

    It doesn't seem like that's the problem, cause the macro stops at the code
    Please Login or Register  to view this content.
    as shown over.

  5. #5
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Problems hiding cells

    Is the file saved as a 2003 workbook. 2003 doesn't have 1048576 rows so it would fail on that. Using Rows.Count would be more optimal and would correct this issue going forwards.

    Bad:
    Please Login or Register  to view this content.
    Good:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-07-2011
    Location
    Trondheim, Norway
    MS-Off Ver
    MS Excel 2013, Norwegian version
    Posts
    16

    Re: Problems hiding cells

    I'm using Office 2010, but found out what was wrong, so this has been solved

+ Reply to Thread

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