+ Reply to Thread
Results 1 to 7 of 7

Run-time error 1004: Unable to set the Hidden property of the Range class

  1. #1
    Registered User
    Join Date
    10-06-2012
    Location
    Singapore
    MS-Off Ver
    Excel 365
    Posts
    50

    Run-time error 1004: Unable to set the Hidden property of the Range class

    Hello friends,
    I hope someone can help me solve the above problem.
    I've an macro that hide and unhide rows.
    I want it to be able to hide the row with an empty cell.
    I also want it to be able to unhide the row if I want to fill in the empty cell.
    I've the worksheet protected to prevent accidental changes to the formula cells.
    However, when the worksheet is protected, the macro cannot work and displayed the above message.
    When it is unprotected, the macro works.
    I've attached an example of the worksheet.

    Thank you.
    KS Chan
    Attached Files Attached Files

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Run-time error 1004: Unable to set the Hidden property of the Range class

    Unprotect the sheet when the sub runs and reprotect it again at the end.
    Please Login or Register  to view this content.
    BSB

  3. #3
    Registered User
    Join Date
    10-06-2012
    Location
    Singapore
    MS-Off Ver
    Excel 365
    Posts
    50

    Re: Run-time error 1004: Unable to set the Hidden property of the Range class

    Thank you very much.
    It is working properly now.

    KS Chan

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Run-time error 1004: Unable to set the Hidden property of the Range class

    No problem. Happy to help

    BSB

  5. #5
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,220

    Re: Run-time error 1004: Unable to set the Hidden property of the Range class

    And I, out of spite will secure the sheet beforehand.
    Please Login or Register  to view this content.
    Artik
    Last edited by Artik; 08-06-2022 at 05:36 AM.

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Run-time error 1004: Unable to set the Hidden property of the Range class

    Be wary, UserInterfaceOnly is not 100% reliable and some performing some actions using code whilst sheets have this property set to True will still throw up errors.

    BSB

  7. #7
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,220

    Re: Run-time error 1004: Unable to set the Hidden property of the Range class

    Quote Originally Posted by BadlySpelledBuoy View Post
    UserInterfaceOnly is not 100% reliable
    I know this, but for OP purposes, this code is possible to use.

    Artik
    Last edited by Artik; 08-06-2022 at 04:08 PM.

+ 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. [SOLVED] Run-time error '1004': Unable to set the Hidden property of the Range class
    By afpecora in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-17-2022, 09:21 AM
  2. Run time error 1004 - Unable to set the hidden property of the range class
    By excelconditional in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-16-2018, 12:09 PM
  3. Run-time error '1004': Unable to set the hidden property of the range class
    By lovekush in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-10-2017, 05:29 AM
  4. [SOLVED] Run-time error '1004' - Unable to set the Hidden property of the Range class
    By redoscar in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-04-2017, 09:34 AM
  5. [SOLVED] Run time error 1004: Unable to set hidden property of range class
    By SAVIOBLUEFOX in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-06-2013, 10:38 AM
  6. Help Please w/ Run-time error '1004' Unable to set the Hidden property of the Range Class
    By ExcelNewbie2534 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2012, 07:38 PM
  7. Run-time error 1004: Unable to set the hidden property of the Range class.
    By seabee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-14-2011, 05:09 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