+ Reply to Thread
Results 1 to 4 of 4

Code not working (hide rows) - two change worksheet codes in one

  1. #1
    Registered User
    Join Date
    06-13-2023
    Location
    Austria
    MS-Off Ver
    365
    Posts
    3

    Unhappy Code not working (hide rows) - two change worksheet codes in one

    Hello,

    so first of all - I'm fairly new to the world of VBA but I do think it's amazing. :-)

    So i do have a form which needs to be filled out by our customers. And i do have a Worksheet_Change Code so that you're able to choose more than one option from a dropdown list which is working perfectly fine. What I would like to do now is to add another code - There's one dropdown (cell D43) with two options "Yes" and "No". If "No" is chosen rows 45 - 52 needs to be hidden, if "Yes" is chosen the rows should be visible. I know how to set up the code in general but i am not able to add it to my existing code so that it is working. Do you have any idea how to do that?

    The existing code looks like that:

    Please Login or Register  to view this content.



    Thanks so much.
    Nadine

  2. #2
    Registered User
    Join Date
    06-13-2023
    Location
    Austria
    MS-Off Ver
    365
    Posts
    3

    Re: Code not working (hide rows) - two change worksheet codes in one

    file attached -sorry!
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    06-13-2023
    Location
    Austria
    MS-Off Ver
    365
    Posts
    3

    Re: Code not working (hide rows) - two change worksheet codes in one

    So I actually was able to get the macro / code running - both are running - as long as the worksheet is unprotected but as soon as I would like to protect the sheet i receive an error message when trying to change anything in the related cells

    "Run time error 1004
    unable to set the hidden property of the range class

    Attachment 832895

    any ideas on this one? :-(

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Code not working (hide rows) - two change worksheet codes in one

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not told us about this. You are required to do so.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important: https://excelguru.ca/a-message-to-forum-cross-posters/

    (Note: this requirement is not optional. As you are new here, I shall do it for you this time: https://www.mrexcel.com/board/thread...o-vba.1239070/)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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. VBA Code to hide rows not working
    By notsosavvy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-20-2016, 07:49 PM
  2. [SOLVED] Worksheet Change Hide/Unhide rows automatically
    By Ollie7957 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-05-2016, 02:01 PM
  3. [SOLVED] Worksheet Selection Change - Hide Rows
    By sl729 in forum Excel General
    Replies: 2
    Last Post: 07-20-2016, 10:45 AM
  4. Code to hide rows is no longer working
    By NancyPez in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-12-2016, 11:36 AM
  5. Delete vs Hide rows code not working
    By cxc300cxc in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-22-2013, 03:41 PM
  6. worksheet change code not working
    By nadie111 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2008, 04:36 PM
  7. Can't hide/unhide rows under worksheet change event?
    By Don Wiss in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-24-2005, 07:02 PM

Tags for this Thread

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