Consulting

Results 1 to 3 of 3

Thread: Solved: show/hide label/textbox based value

  1. #1

    Solved: show/hide label/textbox based value

    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

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    [vba]Private Sub Worksheet_Change(ByVal Target As Range)
    If Range("k1") = 1 Then Label1.Visible = True Else Label1.Visible = False
    End Sub[/vba] 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.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    yes,
    perfect,
    works like a charm
    thx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •