Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkbox help

Status
Not open for further replies.
Feb 4, 2002
792
GB
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:

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
 
Will,

I like your plays, especially the comedies.

You may want to post this in forum707 and in particular which version of Excel you are using (Just following Skip's advice from another post)

Canadian eh! Check out the new social forum Tek-Tips in Canada.
With the state of the world today, monkeys should get grossly insulted when humans claim to be their decendents
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top