dvdlev
New Member
- Joined
- May 24, 2020
- Messages
- 12
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
- MacOS
Hi,
I am trying to write a VBA code that would allow me to hide all columns containing whatever text/option has been selected from a drop down list in excel.
For example, all the options are within columns D:Z. The drop down list contains "Cat", "Dog", "Horse", "Fish". If I am selected on the Cat option in the drop down list then I want to hide all columns in "D:Z" containing Dog/Horse/Fish. On the other hand, if I am selected on "Dog", I want all columns containing "Cat", Horse", "Fish" to be hidden in columns "D:Z" and so on.
I am fairly new to writing VBA code and any help would be MUCH appreciated.
Thank you !
I am trying to write a VBA code that would allow me to hide all columns containing whatever text/option has been selected from a drop down list in excel.
For example, all the options are within columns D:Z. The drop down list contains "Cat", "Dog", "Horse", "Fish". If I am selected on the Cat option in the drop down list then I want to hide all columns in "D:Z" containing Dog/Horse/Fish. On the other hand, if I am selected on "Dog", I want all columns containing "Cat", Horse", "Fish" to be hidden in columns "D:Z" and so on.
I am fairly new to writing VBA code and any help would be MUCH appreciated.
Thank you !