+ Reply to Thread
Results 1 to 5 of 5

Buttons interacting with IF statements

  1. #1
    Forum Contributor
    Join Date
    02-11-2009
    Location
    Montclair, NJ
    MS-Off Ver
    Excel 365
    Posts
    224

    Buttons interacting with IF statements

    Is there a way that i could have a checked button interact with a IF statement

    Example:

    IF(Box is Checked,A1+5,A2+5)


    i just don't know the code, or even if there is any code for this

    Thank you and i appreciate your time,
    Bob

  2. #2
    Forum Contributor
    Join Date
    04-16-2009
    Location
    Stellenbosch, South Africa
    MS-Off Ver
    Excel 2003; Excel 2007; Excel 2010; Excel 2013
    Posts
    136

    Re: Buttons interacting with IF statements

    Hi Bob

    Use the check box from the control toolbar. You can set it wto write to a cell in the format control (Cell Link). TRUE if checked, else FALSE.

    Lets assume it's writing to B1, then you could use the following:

    =IF(B1,A1+5,A2+5)

    EDIT: You can also use a checkbox from the control toolbox and link it to a cell in the properties.
    Last edited by JONvdHeyden; 05-15-2009 at 10:31 AM.
    Regards

    Jon (Excel 2003, 2007, 2010, 2013)

  3. #3
    Forum Contributor
    Join Date
    02-11-2009
    Location
    Montclair, NJ
    MS-Off Ver
    Excel 365
    Posts
    224

    Re: Buttons interacting with IF statements

    I'm sorry, i'm a little confused...if it's not a problem, would you mind showing me through excel?

    Thank you,
    Bob
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Buttons interacting with IF statements

    Attached are examples of the Forms Checkbox and the Active X checkboxes.
    I have the forms Checkbox linked to A1 and the Active X checkbox linked to A2. I also pasted in screen shots of how they are linked. For Forms, right click and "Format Control" For Active X, Right click and select Properties.
    Typically, I pick the cell underneath the checkbox itself so you don't actually see the True/False. Then set up your IF statement as Jon described. Make sense?
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Forum Contributor
    Join Date
    04-16-2009
    Location
    Stellenbosch, South Africa
    MS-Off Ver
    Excel 2003; Excel 2007; Excel 2010; Excel 2013
    Posts
    136

    Re: Buttons interacting with IF statements

    Attached includes instructions.

    I'm on xl2003 (office app) so uploaded in .xls format.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1