CorrieAnn Gillen
New Member
I have a dashboard I am creating for a client. I Only want the buttons (controls) to be active if the associated checkbox = true. I have read tons of code samples online, but for some reason, they don't work with MS Excel 2010. Here are a few versions of what I have tried:
--------------------------
cbExternal or anything of the like are the names of my check boxes.
btn* are the names of my buttons.
The point is that I don't want the buttons/controls to be clickable unless they select the check box next to them first.
The best I can make happen so far is to get the font to turn grey "implying" that the button is inactive, but it still works. Then I tried one where Shp.Visible = False, but that only deleted the shape and now it is gone. Grr.
Code:
Private Sub Workbook_Open()
'ActiveSheet.Shapes("btnInternal").ControlFormat.Enabled = False
'ActiveSheet.Shapes("btnExternal").ControlFormat.Enabled = False
'ActiveSheet.Shapes("btnMapping").ControlFormat.Enabled = False
'ActiveSheet.Shapes("btnRDF").ControlFormat.Enabled = False
End Sub
Sub BtnOff()
'If cbInternal = False Then
' ActiveSheet.Shapes("btnInternal").ControlFormat.Enabled = False
' ActiveSheet.Shapes("btnInternal").DrawingObject.Font.ColorIndex = 16
' Else
' ActiveSheet.Shapes("btnInternal").OnAction = ActiveWorkbook.btnInternal & "btn_PRKLogInternalTab"
' ActiveSheet.Shapes("btnInternal").DrawingObject.Font.ColorIndex = 1
End Sub
Sub HideInternalBtn()
' Dim WS As Worksheet: Set WS = ActiveSheet
' Dim Shp As Shape: Set Shp = WS.Shapes("btnInternal")
'If cbInternal = True Then
' Shp.Visible = True
'End If
'If cbInternal = False Then
' Shp.Visible = False
'End If
End Sub
Sub HideLikeFundBtn()
If Range("c14").Select = True Then
'If cbExternal = True Then
Call btn_LikeFundTab
Else
If Range("c14").Select = False Then
'If cbExternal = False Then
Call GreyOutbtnLikefundTab
End If
End Sub
cbExternal or anything of the like are the names of my check boxes.
btn* are the names of my buttons.
The point is that I don't want the buttons/controls to be clickable unless they select the check box next to them first.
The best I can make happen so far is to get the font to turn grey "implying" that the button is inactive, but it still works. Then I tried one where Shp.Visible = False, but that only deleted the shape and now it is gone. Grr.