I have explained in attached.
Criteria to Show/Hide are in D2:D6
"X" in D2:D6 mean Show Range, Nothing in D2:D6 mean Hide all
I have explained in attached.
Criteria to Show/Hide are in D2:D6
"X" in D2:D6 mean Show Range, Nothing in D2:D6 mean Hide all
Hi, this could do the trick:CheersPlease Login or Register to view this content.
Erwin
I started learning VBA because I was lazy ...
Still developing.... being more lazy...
You are complicating this by using merged cells which most of us avoid.
Are you able to hold A1 in B9:B13, A2 in B14:B16...etc?
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star icon below the post.
According to the attachment as it is except cells from A7 to K7 must be empty
- for a smart enough worksheet as the better place for comments is the initial post rather than in a worksheet -
a VBA beginner starter :
PHP Code:
Sub Demo1()
Dim V, R
Application.ScreenUpdating = False
With [B8].CurrentRegion.Rows
.Item("2:" & .Count).EntireRow.Hidden = True
For Each V In Filter([TRANSPOSE(IF(D2:D6="X",C2:C6))], False, False)
R = Application.Match(V, .Columns(1), 0)
If IsNumeric(R) Then .Cells(R, 1).MergeArea.EntireRow.Hidden = False
Next
End With
Application.ScreenUpdating = True
End Sub
► Do you like it ? ► ► So thanks to click on bottom left star icon « ★ Add Reputation » !
Please see attached, I can not make it work !
My Options are hidden now !
Please see my attachment
Cheers
Erwin
Un-hide all the rows and try:
Please Login or Register to view this content.
Last edited by Mumps1; 03-15-2020 at 10:35 AM.
You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
Practice makes perfect. I'm very far from perfect so I'm still practising.
For me do not work.
Maybe I did not explain good.
Say, there is only one "X" in D2
I want to show Range A1, which are Rows 9 to 13 and Hide bellow 13
Say, there are "X" in D3 and D5
I want to Show Range B1 which are Rows 14 to 16 and Range D1 which are Rows 23 to 24
Well works on my side with the initial attachment according to post #4 directions …
Last edited by Marc L; 03-15-2020 at 10:45 AM.
Have you tried the macro I suggested in Post #8?
Could you please attach back with your code from post 8 ?
Maybe I did not explain well but I want to Hide/Show "Rows Range" based on "X'" from D2:D6
"X" in D2 mean SHOW Row 9 to 13 and Hide Row 14 to 27
"X" in D2 and D4 mean SHOW Row 9 to 13, Row 17 to 22 and Hide the remaining
Last edited by ionelz; 03-15-2020 at 11:19 AM.
Try the attached file.
Thank you, I not sure what is wrong !
It work when download but then it doesn't
After a few adding /removing "X" it stop working
Sorry ! I may do someting wrong ...
Sorry, one moment please, looks like X was case sensitive !!!!!
THAT IS EXACTLY WHAT I WAS LOOKING FOR !
Could you PLEASE, reverse ! so it work the opposite !?
Right now, if all are X then all are hidden
I want X to show not to hide, if there is no X all are Hide, as soon as one X is in then Show
Last edited by ionelz; 03-15-2020 at 11:36 AM.
Just change "True" to "False" in the code. (without the quotes)
Here's one way
Please Login or Register to view this content.
I have noticed that, if A1 is MERGED (b9:b13), then it doesn't work !
So, if all are X and A1 is MERGED, than A1 stay (do not work)
If I UNMERGE A1 then it work !
Eastw00d, could you PLEASE reattach with your Code
Richard, super cool !
Thank you
Try:
Please Login or Register to view this content.
Thank you, thank you for this second option...
My pleasure.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks