I have a worksheet that I have created that unhides columns based on what is selected in a dropdown. My problem is that when those hidden columns appear and I select a value from the drop down in that previously hidden column all the columns that I want to stay hidden appear. I have tried updating the "Lotus compatibility" settings and that doesn't seem to work. A small portion of my code looks like below:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
If Target.Column = 7 And Target.Row = 3 And Target.Value = "1" Then
Application.Columns("I:M").Select
Application.Selection.EntireColumn.Hidden = True
Else
Application.Columns("I:M").Select
Application.Selection.EntireColumn.Hidden = False
If Target.Column = 7 And Target.Row = 3 And Target.Value = "2" Then
Application.Columns("J:M").Select
Application.Selection.EntireColumn.Hidden = True
Else
Application.Columns("J:M").Select
Application.Selection.EntireColumn.Hidden = False
I'm probably doing this whole forum thing wrong so I'm sorry! Very new to this and am pretty lost!
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
If Target.Column = 7 And Target.Row = 3 And Target.Value = "1" Then
Application.Columns("I:M").Select
Application.Selection.EntireColumn.Hidden = True
Else
Application.Columns("I:M").Select
Application.Selection.EntireColumn.Hidden = False
If Target.Column = 7 And Target.Row = 3 And Target.Value = "2" Then
Application.Columns("J:M").Select
Application.Selection.EntireColumn.Hidden = True
Else
Application.Columns("J:M").Select
Application.Selection.EntireColumn.Hidden = False
I'm probably doing this whole forum thing wrong so I'm sorry! Very new to this and am pretty lost!