Auto hide rows based on cell value

Anonymous
2019-05-08T03:32:51+00:00

Hi all,

I'm very sorry if this has been answered elsewhere, but I'd like to hide a select number of rows based on a cell value and perform this several times within a sheet.

Ie.:

Based on the cell value in C3, I'd potentially like rows 5 to 23 hidden.

Based on the cell value in C25, I'd potentially like rows 26 to 44 hidden.

Based on the cell value in C48, I'd potentially like rows 56 to 65 hidden.

And so on, there's about another 10 hidden sections the same as the 3rd line above.

I've seen some answers that are similar but without understanding the intricacies of coding I've failed in making the changes work for me.

Any help will be HUGELY appreciated!

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

8 answers

Sort by: Most helpful
  1. Anonymous
    2019-05-13T02:12:33+00:00

    Hi Jeovany,

    Sorry for the delay, but I had to wait to get back into work to test it out. I'm not sure what I'm doing wrong. I've opened the code and copied and pasted your formula in (see below screenshot) but it's not behaving as intended when I select from the drop down.

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2019-05-13T04:17:50+00:00

    Hi Jeovany,

    I think its because macros aren't enabled. I enabled them originally, but our security team ran an update last week which disabled them. I'm just trying to get permission to enable them again. Will keep you updated if its still not working afterwards.

    Thank you

    Andrew North

    0 comments No comments
  3. Anonymous
    2019-05-13T13:30:48+00:00

    Hi Andrew

    Hope your IT team enable the macros

    Because the code is OK and does exactly what you asked.

    0 comments No comments