Marcro updating cell that is "locked"
I have a worksheet that is a survey. Users press radio
buttons evaluating statements on a scale of 1 to 5 (with between 5 and 10 questions per worksheet). On the bottom of the sheet is an average of their score (ie it changes each time somebody selects a different scale on one of the questions). I don't want people selecting the cells (only pushing radio buttons), so I have locked the worksheet. However, when I do this, the macro gets an error when it tries to update the cells with the average score. How do I work around this. Thanks |
Marcro updating cell that is "locked"
One thing you can do is (with code) lock the worksheet with
userinterfaceonly = true. However, you need to do this every time the worksheet opens, otherwise the sheet will revert to regular locked protection. The other option would be to have your code unlock the sheet every time it wants to change the average score, then relock it afterwards. I think setting worksheet.protect userinterfaceonly:=true is the better option. You just need to make sure that the macro knows the password. Mike -- __________________________________________________ __________________________ ________________ Please reply to newsgroup so everyone can benefit. Email address is not valid (see sparkingwire.com) __________________________________________________ __________________________ ________________ "Jim" wrote in message ... I have a worksheet that is a survey. Users press radio buttons evaluating statements on a scale of 1 to 5 (with between 5 and 10 questions per worksheet). On the bottom of the sheet is an average of their score (ie it changes each time somebody selects a different scale on one of the questions). I don't want people selecting the cells (only pushing radio buttons), so I have locked the worksheet. However, when I do this, the macro gets an error when it tries to update the cells with the average score. How do I work around this. Thanks |
All times are GMT +1. The time now is 01:49 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com