WillShakespeare
MIS
Strange as I thought I had already posted a message, but can't find it! Here is my problem:
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