Hi ,
I need a help to hide a column based on the value in other field in Excel.
Below is my example:
When i open my excel, I want to hide a Column 'I',
If field "D3" has "0".
Else Field "D3" has "1" can visible.
I use below code , But it was working when i change the value in D3 field. But when i open the file itself need to hide.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$3" And Target.Text = "0" Then
Range("I:I").EntireColumn.Hidden = True
Else
If Target.Address = "$D$3" And Target.Value = "1" Then
Range("I:I").EntireColumn.Hidden = False
End If
End If
End Sub
But it was working after changing the value in that field. Need to validate when its open.
Thanks
Venu
I need a help to hide a column based on the value in other field in Excel.
Below is my example:
When i open my excel, I want to hide a Column 'I',
If field "D3" has "0".
Else Field "D3" has "1" can visible.
I use below code , But it was working when i change the value in D3 field. But when i open the file itself need to hide.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$3" And Target.Text = "0" Then
Range("I:I").EntireColumn.Hidden = True
Else
If Target.Address = "$D$3" And Target.Value = "1" Then
Range("I:I").EntireColumn.Hidden = False
End If
End If
End Sub
But it was working after changing the value in that field. Need to validate when its open.
Thanks
Venu