WillShakespeare
MIS
Weird, I trie dto post the below message, but it seems not to appear. I have also posted it in Office area in case someone there can help. Happy to delete one or other once I find out which is more popular...
In a spreadsheet I have a checkbox that when selected I want a cell to appear (let's call it "new") and a checkbox next to it.
I can use CHOOSE() function to put the name "new" into the cell, based on the existingc checkbox, but I struggled to get the "new" checkbox to appear.
So, I delved into creating a function and here is what I have:
Oddly, some of it works, but some of it doesn't! The "new" checkbox becomes visible or invisible as required, but "New" does not appear in cell A19 and I get a #VALUE error for the return value True or False, as required.
Can anyone help?
Thanks in advance,
Will
In a spreadsheet I have a checkbox that when selected I want a cell to appear (let's call it "new") and a checkbox next to it.
I can use CHOOSE() function to put the name "new" into the cell, based on the existingc checkbox, but I struggled to get the "new" checkbox to appear.
So, I delved into creating a function and here is what I have:
Code:
Function InsertNew(myCheck As Boolean)
If myCheck = True Then
ActiveSheet.Shapes("Check Box 37").Visible = True
Range("A19").Select
ActiveCell.FormulaR1C1 = "New"
InsertNew = True
Else
ActiveSheet.Shapes("Check Box 37").Visible = False
Range("A19").Select
ActiveCell.FormulaR1C1 = ""
InsertNew = False
End If
End Function
Oddly, some of it works, but some of it doesn't! The "new" checkbox becomes visible or invisible as required, but "New" does not appear in cell A19 and I get a #VALUE error for the return value True or False, as required.
Can anyone help?
Thanks in advance,
Will