
Originally Posted by
6StringJazzer
"when a cell is blank I want the active x check box not to be visible but when the cell is populated by a formula I want the check box to be visible."
If there is a formula in a cell, and the result is blank, the cell is still being populated by the formula, so your description is a little ambiguous.
Do you mean: There is a formula in the cell. When the result of the formula is the null string, I want the checkbox to be invisible. When the formula produces a non-null result, I want the checkbox to be visible.
If that's what you mean then set your checkboxes up to be named CheckBox1, CheckBox2, etc.
Private Sub Worksheet_Calculate()
Dim C As Range
Dim CBNum As Long
For Each C In Range("B25:B39")
CBNum = CBNum + 1
Me.Shapes("CheckBox" & CBNum).Visible = (C.Value <> "")
Next C
End Sub
Appologies yes thats what I mean
The formula I have is
Formula:
=IF($B$9='Reference Sheet'!$B$1,'Reference Sheet'!B2,IF($B$9='Reference Sheet'!$C$1,'Reference Sheet'!C2,IF($B$9='Reference Sheet'!$D$1,'Reference Sheet'!D2,IF($B$9='Reference Sheet'!$E$1,'Reference Sheet'!E2,IF($B$9='Reference Sheet'!$F$1,'Reference Sheet'!F2,IF($B$9='Reference Sheet'!$G$1,'Reference Sheet'!G2,IF($B$9='Reference Sheet'!$H$1,'Reference Sheet'!H2,"")))))))
So I want the checkbox hidden if the formula result returns ""
I have tried the code you kindly provided for me but I cant seem to get the desired result, maybe i'm being silly.
I Have attached the workbook
I get the following error as per screenshots.
Macro Error.jpg
Macro Error1.jpg
Bookmarks