Format and Hide label on worksheet

KimberC

New Member
Joined
Jul 19, 2010
Messages
14
I have created a label and would like to make it bold and turn it green when a named cell is has a value of true and hide the label when the value is false. I see threads on how to do this if I had used a userform, but I don't see how to do it when the label is on the workbook.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi KimberC, welcome to the board,

If your label is from the 'Controls' toolbar and not the 'Forms' toolbar, try this;
Create your label and format it how you want and use this code;
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case Range("A1").Value
Case Is = "True"
Label1.Visible = True
Case Is <> "True"
Label1.Visible = False
End Select
End Sub

I used cell A1 and the word 'True' to test this.

EDIT: Ooops, paste this in the worksheet module :oops:
HTH
Colin
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,460
Members
448,965
Latest member
grijken

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top