I hope you can help me with this challenge that I have in Excel VBA. I'm not sure how to explain this, but I'll do my best.
I want to "hide" two columns if, the two columns contains the same text in both cell "D4" and cell "E4".
The text in the columns will not always be the same. Sometimes it's fx "TEST" in both of them "D4" & "E4", sometimes the text is "NOTEST" in both cells, and sometimes again it might only have the text in one out of the two cells, which means the column shouldn't be hidden.
If the explanation is to weak, please let me know and I'll try to explain it differently.
Thanks in advance!
You can use the following Sub.
You can choose your two cells in firstCaseToCheck and secondCaseToCheck and choose your sheet with nameOfYourSheet. This will let you change all this without problem.
Give this a try: