+ Reply to Thread
Results 1 to 10 of 10

checkbox programming

  1. #1
    Registered User
    Join Date
    06-03-2010
    Location
    Sinaloa, Mexico
    MS-Off Ver
    Excel 2003
    Posts
    20

    checkbox programming

    Hi, now im asking about how to program a check box, i tried to do it the same way that optionbutton but , is not working.

    I can put data in the cell D16, but it does not respect the option of if then else.

    i want to put some data in the worksheet 8, in the cell b16 if the checkbox is checked and if is not write in the cell d16.

    this is what im using.

    Please Login or Register  to view this content.
    Last edited by napo537; 06-08-2010 at 04:49 PM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: checkbox programing

    Are TextBox14 and Checkbox1 on Worksheets(8) ?
    (Better described as Sheets("Sheet8") or Sheet8)
    or
    are they on a Userform?

    Assuming they are on Worksheets(8) put this in the module for Worksheets(8) not in a standard module

    To get the correct sheet module select Worksheets(8), then Right Click on the sheet tab and then click > view code

    Paste this in the resultant window/pane

    Please Login or Register  to view this content.

    Let us know how you get on with this, I can see a few problems that might arise later.

    Hope this helps.

    However

    If this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody!
    Also
    If you are satisfied by any members response to your problem please consider using the scales icon top right of thier post to show your appreciation.

  3. #3
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: checkbox programing

    Is it an ActiveX checkbox or from the Forms menu?
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  4. #4
    Registered User
    Join Date
    06-03-2010
    Location
    Sinaloa, Mexico
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: checkbox programing

    Ok, im going to try to use the tips you gave me. But i will describe my problem again because my writting was not so clear.

    Im working in a userform to change cell values in a workbook that has 11 sheets. In this form i have done some things as changing values from the userform in different cell of different sheets, with a determinate configuration of characters.

    i also have some frames in this user form, and in one if then, i have two checkboxs, and one textbox, in this textbox i want to program that if i checked checkbox1, the writting in textbox 14 is changing the cell B16 of sheet8, and if i do not check checkbox1 or i check checkbox2 write in cell D16 of sheet8.

    thank you, very much

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: checkbox programing

    Quote Originally Posted by napo537 View Post
    .... if i checked checkbox1, the writting in textbox 14 is changing the cell B16 of sheet8, and if i do not check checkbox1 or i check checkbox2 write in cell D16 of sheet8.

    thank you, very much
    You didn't mention what you want to happen if neither is checked, but you might try this
    Please Login or Register  to view this content.

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: checkbox programming

    You would do best to post a sample workbook showing your Userform and some data to work with.

    It should clearly illustrate your problem and not contain any sensitive data.

    Cheers

  7. #7
    Registered User
    Join Date
    06-03-2010
    Location
    Sinaloa, Mexico
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: checkbox programing

    Quote Originally Posted by mikerickson View Post
    Is it an ActiveX checkbox or from the Forms menu?
    Its from the forms menu, thank you

  8. #8
    Registered User
    Join Date
    06-03-2010
    Location
    Sinaloa, Mexico
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: checkbox programing

    Quote Originally Posted by mikerickson View Post
    You didn't mention what you want to happen if neither is checked, but you might try this
    Please Login or Register  to view this content.
    I tried your code, but it gaves me an error, of "there is a missing object"

    thank you.

    A, if neither of the checkbox is selected, maybe ti could send a message like, " You need to select one "

  9. #9
    Registered User
    Join Date
    06-03-2010
    Location
    Sinaloa, Mexico
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: checkbox programming

    Quote Originally Posted by Marcol View Post
    You would do best to post a sample workbook showing your Userform and some data to work with.

    It should clearly illustrate your problem and not contain any sensitive data.

    Cheers
    Hello, i think that i attached the file with my userform.

    With the code you gave me before, it happens the same, i can write only in cell D16 of sheet8, but it does not produce any change if i choose either checkbox1 or checkbox2

    This is what im using now, but it the same
    Please Login or Register  to view this content.
    I dont know if the problem might be, that im programming in textbox14 and i should program in the checkboxbutton-

    see you later, thank you

  10. #10
    Registered User
    Join Date
    06-03-2010
    Location
    Sinaloa, Mexico
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: checkbox programming

    i was trying a lot and it seems to be working now. i made some changes.

    This is the code:

    Please Login or Register  to view this content.

+ 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