Jihad Akoury
New Member
- Joined
- Aug 17, 2015
- Messages
- 13
Hello friends,
I created an ActiveX button in excel and want it to hide or unhide depending on some conditions,
I checked another thread on this forum where they used the following code:
Private Sub Worksheet_Change(ByVal Target As Range) Dim sAddress As String
sAddress = "D8"
With ActiveSheet
If Intersect(Target, Range(sAddress)) _
Is Nothing Then Exit Sub
Debug.Print Range(sAddress).Value
On Error GoTo CleanUp
Application.EnableEvents = False
Me.CheckBox1.Visible = _
(Range(sAddress).Value = "Yes")
End With
CleanUp:
Application.EnableEvents = True
End Sub
But as it shows, the button will show only if the cell text value is "Yes"
What should i do if i want the button to appear if the cell text value is equal to "Yes" or "True" or "Correct"...
In other words, i want to define multiple texts that will make the button appear.
Thank you in advance guys
You would save my life if i get the answer
I created an ActiveX button in excel and want it to hide or unhide depending on some conditions,
I checked another thread on this forum where they used the following code:
Private Sub Worksheet_Change(ByVal Target As Range) Dim sAddress As String
sAddress = "D8"
With ActiveSheet
If Intersect(Target, Range(sAddress)) _
Is Nothing Then Exit Sub
Debug.Print Range(sAddress).Value
On Error GoTo CleanUp
Application.EnableEvents = False
Me.CheckBox1.Visible = _
(Range(sAddress).Value = "Yes")
End With
CleanUp:
Application.EnableEvents = True
End Sub
But as it shows, the button will show only if the cell text value is "Yes"
What should i do if i want the button to appear if the cell text value is equal to "Yes" or "True" or "Correct"...
In other words, i want to define multiple texts that will make the button appear.
Thank you in advance guys
You would save my life if i get the answer