PDA

View Full Version : Solved: show/hide label/textbox based value



danovkos
03-19-2010, 02:20 AM
Hi all,
pls. how can i do folowing


i want to show/hide text box/label based value in cell B1.
If is there 1, textbox will appear, if is value not equal to 1, it will disappear.
I know, that it will be in ThisWorkbook in Workbook_SheetChange event, but my try doesnt Works.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Sheets("KRIZ").Label1_Click("Label1").Visible = False
If Range("k1") = 1 Then
Sheets("KRIZ").Label1_Click("Label1").Visible = True
End If
End Sub

thx for help

p45cal
03-19-2010, 02:58 AM
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("k1") = 1 Then Label1.Visible = True Else Label1.Visible = False
End Sub This should be in the KRIZ sheet's code module rather than the Thisworkbook code module.
Also replace k1 above with B1 depending on just which cell you want to check.

danovkos
03-19-2010, 03:13 AM
yes,
perfect,
works like a charm :)
thx