Forum Discussion
Steiny88
Jul 24, 2022Copper Contributor
Hide rows in a different sheet based on a value (that contains specific letters)
I have 2 sheets and attached an example: Sheet1 D8 has Baby as value Sheet1 D9 has Man as value Sheet1 D10 has Woman as value The code to search for "ab" in column D and if it finds it somewh...
HansVogelaar
Jul 24, 2022MVP
"ma" occurs in D9 and D10. Doesn't that cause confusion?
- Steiny88Jul 24, 2022Copper ContributorI didn't realize that 😄
Let's say to use wo from woman as I will not have any duplications in the original file.- HansVogelaarJul 24, 2022MVP
See the attached workbook. It is now a macro-enabled workbook (*.xlsm) so you'll have to allow macros when you open it.
To view the code, right-click the sheet tab of Sheet1 and select 'View Code' from the context menu.
- Steiny88Jul 24, 2022Copper ContributorThat works perfectly.
I have one more question. In the code I cannot see which rows to hide as in my original file I need to hide for example Row 8 and then Row 19 then Row 32 but in the code I don't understand how it knows which row to hide. If there is ab to select which exact rows to hide - for example for ab to hide row 8 and 19, how can I do that in the code?
Thanks a lot!