+ Reply to Thread
Results 1 to 11 of 11

Problem with making protected datat entry form with radiobuttons

  1. #1
    Registered User
    Join Date
    02-05-2011
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    56

    Question Problem with making protected datat entry form with radiobuttons

    Hi all,

    This forum is a huge help to me (thanks all!) and usually I'm able to find what I need without starting a new thread, but here's an exception

    I'm making a userform. I want to protect it so users can only modify certain cells. So I set the editable cells as 'unlocked' and locked the rest of the sheet.
    That has worked fine in the past but those forms didn't have radiobuttons. This one does. I have several groups of radiobuttons. Selecting a radiobutton triggers a macro (radiobutton's private subroutine) that changes a corresponding cell from 0 to 1.
    I'm using that output to drive certain other things: conditional formatting in other cells etc. (I know, probably not the most elegant way to work but I'm just getting started on the macro stuff.)

    Here's the problem: when I protect my sheet and change a radiobutton I get an error: "the cell you are trying to modify is protected and therefore locked" etcetera. At first I figured the radiobuttons had to be set to 'unlocked' as well, but this didn't make a difference. Also, some (unlocked) cells trigger a 0 or 1 in another cell as well (including resulting conditional formatting and other stuff) and this works when the sheet is protected.

    I haven't been able to find out how to protect my sheet and still have functioning radiobuttons...

    Anyone?
    Last edited by supern0va; 05-23-2012 at 05:09 AM.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Problem with making protected userform with radiobuttons

    I assume you have checked that the cells you are trying to modify are definitely unlocked?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    02-05-2011
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: Problem with making protected userform with radiobuttons

    The cells where a user is meant to enter text are unlocked, yes.
    Based on whether a cell like this contains an entry, another cell's value is changed from 0 to 1 or vice versa.
    Those on/off cells are locked. But when I protect the sheet and enter a value in an entry field (unlocked cell), the on/off cell changes value without problems.
    It's only when I use a radio button that the problem occurs. Switching those radio buttons to locked / unlocked doesn't make a difference.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Problem with making protected userform with radiobuttons

    I mean are the cells that the radio buttons changes locked?

  5. #5
    Registered User
    Join Date
    02-05-2011
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: Problem with making protected userform with radiobuttons

    Yes. Like the cells that are changed by the text entry cells.

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Problem with making protected userform with radiobuttons

    can you post a workbook?

  7. #7
    Registered User
    Join Date
    02-05-2011
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: Problem with making protected userform with radiobuttons

    Yep! See attached.
    Try protecting the form and then ticking the 'salesman' or 'customer contact' radiobutton.
    I made text in the on/off cells (0 or 1, TRUE or FALSE) black. Usually it'd be the same as the background color.
    Attached Files Attached Files

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Problem with making protected userform with radiobuttons

    that's not a userform in the excel sense. that's a data entry form (a userform is a form that you design in the vbeditor and then show in code)
    your problem is that the cells that the optionbuttons are linked to (A12 and A13) are locked.

  9. #9
    Registered User
    Join Date
    02-05-2011
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: Problem with making protected userform with radiobuttons

    Hi Joseph,

    Thanks for clearing that up. I want to make a form for users so I figured... Oh well

    The thing that I don't understand is this. I use plenty of locked cells whose entries change (0 / 1) based on other actions.
    Columns N:Q are full of them. And there I do not have this problem. Ideally I don't want users to be able to select any other cells than the ones they are supposed to enter data in. Why do the 'TRUE / FALSE' entries in column A behave differently than the '0 / 1' values in columns N:Q? Does excel treat TRUE / FALSE in a different way?

  10. #10
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Problem with making protected userform with radiobuttons

    the cells in columns N and O are formulas and you are not changing the formulas-they're just recalculating. the cells in column A you are actually directly changing the contents. you should just be able to unlock them though?

  11. #11
    Registered User
    Join Date
    02-05-2011
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: Problem with making protected userform with radiobuttons

    Yeah, I guess so... Ok. At least I know why the sheet behaves the way it does. Thanks a lot for your help Joseph!

+ 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