How to automatically hide rows in sheet based on different sheet cell value

  • Hello,


    I'm new to VBA and have a problem, so I hope - you can help me :)


    If I have two worksheets, first called DATA and second called FORM, and I want to hide rows in FORM based on the cell value (drop down list with 7 options, which should hide different ranges) in DATA. I wrote the code in FORM sheet and I made in cell B1 easy function like B1=DATA!A1 - and after changing this value in DATA the value changes, but nothing is automatically hidden. I can hide if after I enter the cell B1, press the formula on formula bar and click enter - then it works.


    My code is written in FORM sheet and looks like this:



    Could you tell me how to change it to make it automatic? I mean when B1 change value, my rows are hidden or unhidden.

  • Hi & welcome to the board.

    How about

    This needs to go in the Data sheet module