santoshloka
Board Regular
- Joined
- Aug 31, 2017
- Messages
- 125
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$5" Then
Dim b13val As String
b13val = Target.Value
If b13val = "1" Then
Sheets("INPUT").Range("E:G").EntireColumn.Hidden = True
ElseIf b13val = "2" Or b13val = "3" Or b13val = "4" Then
Sheets("INPUT").Range.Range("F:G").EntireColumn.Show
If b13val = "2" Then
Sheets("INPUT").Range("F:G").EntireColumn.Hidden = True
ElseIf b13val = "1" Or b13val = "3" Or b13val = "4" Then
Sheets("INPUT").Range.Range("F:G").EntireColumn.Show
If b13val = "3" Then
Sheets("INPUT").Range("G").EntireColumn.Hidden = True
ElseIf b13val = "1" Or b13val = "2" Or b13val = "4" Then
Sheets("INPUT").Range.Range("F:G").EntireColumn.Show
ElseIf b13val = "4" Or b13val = "" Then
Sheets("INPUT").Columns("D:G").Hidden = False
Else
Sheets("INPUT").Columns.Hidden = False
End If
End If
End If
End If
End Sub
please find the image below
https://drive.google.com/open?id=0B8-usD7SI_4aMzR1VlU5M2gxY3c