Show Hide Button if specific text is displayed in cell

DaveOver

New Member
Joined
Feb 26, 2018
Messages
3
I want to hide or show "Button 27" depending on the text displayed in a Cell D25.

The Button is called "Button 27"

I want "Button 27" to be "Visible - True" if the text in "Cell D25" has this entry "To be stored in Teamcenter"

I want "Button 27" to be "Visible - False" if the text in "Cell D25" does not say "To be stored in Teamcenter"
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
D25 is changed in accordance with the following formula after selecting a document type from a LOV in cell D10..

="To be stored in"&" "&VLOOKUP(D10;'Document Details'!B3:D97;3;FALSE)
 
Upvote 0
something along the lines of

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("d25") = "Yes" Then
ActiveSheet.Shapes.Range(Array("Button 2")).Visible = False
Else
ActiveSheet.Shapes.Range(Array("Button 2")).Visible = True
End If
End Sub
 
Upvote 0
Steven,

Thanks very much...

I used this variation of your suggestion and it works perfectly.

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("d25") = "To be stored in Teamcenter" Then
ActiveSheet.Shapes.Range(Array("Button 27")).Visible = True
Else
ActiveSheet.Shapes.Range(Array("Button 27")).Visible = False
End If
End Sub

Have a great day.
DaveO
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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