Macro or VB code to hide and unhide Label box

D

Den

I need your help to create a macro or a Visual Basic code that do the
following: I have a cell with a macro that shows “Meets†or “Does not Meetsâ€
depending of the result of other cell. That I’m trying to do is a macro or
visual basic code that display a Label box when “Meets†is showed and hidden
it when “Does not Meet†is showed. I'm trying a VB code using the if
statement to change the visible property (to False and True) of the Label
box but is not working. I'm not very familiarized with visual basic and I’m
not at the level of skills of many of you so please take that in
consideration for any suggestion.

Thanks in advance…
 
F

FSt1

hi
i use a label from the control toolbox for this.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set Target = Range("A2") '<<<<<change to suit your data
If Target.Value = "meets" Then
Label1.Visible = True
Else
Label1.Visible = False
End If
End Sub

this is sheet code. right click the sheet tab and click view code. paste the
code in the code pane that comes up.

regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top