1

I have a dropdown list in cell "B3", containing numbers 1 through 18. 1 corresponds to column C, 2 to column D, 3 to Column E and 18 to column T. I want to achieve the following:

If I select 3 from the dropdown list, column "E" of columns C:T will be visible, if 7 is selected column "I" will be the only column displayed from columns C:T.

I have been unable to find vba codes that work. Does anyone have a solution?

2
  • 1
    Excel or Google Sheets? Commented Feb 11, 2020 at 14:58
  • Welcome to Stack Overflow. Try to be more specific about which program, coding language, framework or platform you are using, not only in tags but in your title as well Commented Feb 11, 2020 at 16:04

1 Answer 1

1

Once you know how to read the value of the dropdown list (call it x), do following code:

Columns(,x + 2).EntireColumn.Hidden = True
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.