Based on the value stored in a specific cell such as A1 of a worksheet I would like to hide a number of columns in the worksheet starting with column B.
Examples of what I am trying to do:
- If the value of cell A1 = 10, then hide column B plus 10 columns after B
- If the value of cell A2 = 11, then hide column B plus 11 columns after B
The difficulty is actually the way Excel (or least my Excel files) uses the alphabet (A, B, ...) for the name of the columns. I have done this on rows before using code like rows("2:" & range("A1").value) and set .hide = true