Form Control vs. Active X Controls
Patrick,
I'm struggling with your code, nothing happens. I'm not a VBA guy, please
review:
Public Sub LoanDetailCheckbox_Click()
If Worksheets("Loan Data").Range("$F$2").Value Then
Hide_Loan_Details
Else
Show_Loan_Details
End If
End Sub
The Sheet name is 'Loan Data'. The Form Control Check Box name is
'LoanDetailCheckbox'. The cell where TRUE or FALSE is displayed is F2.
Thanks for the quick reply.
"Patrick Molloy" wrote:
the control needs to be linked to a cell, so when clicked, the target cell
will be TRUE or FALSE
put your code into a standard module as assign your control's Assign Macro
property to it
eg
PUBLIC Sub CheckBox1_Click()
If worksheets("sheet1").Range("A1").Value Then
Hide_Loan_Details
Else
Show_Loan_Details
End If
End Sub
"Jim" wrote in message
...
I'm using Excel 2007 and want to put a check box above a range of cells
that
I want to assign two macros, one for checked, one for unchecked. I
struggled
for hours to get it working until I discovered I was using a Form Control
Check Box, not an Active X Control Check Box.
Using an Active X check box (Developer ribbon, controls, insert active x
check box) and the following code I can made it work:
Private Sub CheckBox1_Click()
If CheckBox1.Value = False Then
Hide_Loan_Details
Else
Show_Loan_Details
End If
End Sub
However I do prefer the Form Control Check box as it looks better, can be
filled with colours, etc. I've tried the following code and cannot make
it
work:
Private Sub LoanDetailCheckbox_Change()
If LoanDetailCheckbox.Value = xlOn Then
Show_Loan_Details
Else
Hide_Loan_Details
End If
End Sub
Is it possible to use the Form Control Check box in my worksheet?
|