Hi all,
I was wondering whether there is a way of protecting cells/worksheet so that a user cannot input any information on a worksheet except through a userform?
Thanks.
Hi all,
I was wondering whether there is a way of protecting cells/worksheet so that a user cannot input any information on a worksheet except through a userform?
Thanks.
Last edited by sgp; 11-12-2011 at 04:28 PM.
Lock all the cells and protect the worksheet.
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
Tried - but then the data from the Userform does not record on the worksheet, which makes sense why because I have protected the cells..is there are way where inputting data can only be done through UserForms. and not directly on the worksheets?
Thanks.
Have a look at the Protect Method in the VBA help. You can set it with the UserInterfaceOnly option which means any changes made by VBA are allowed whilst preventing the user from modifying the worksheet.
Note that you need to apply this protection each time the workbook is opened, see the remarks in the help topic.
The other option is to just Unprotect and Protect your worksheet each time you want the code to make changes to it.
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
Hi Domski,
Are you reffering to following link:
http://www.exceltip.com/show_tip/Pro...Excel/337.html
Thanks
Hi Domski
The coding works but "Only cells with formulas are to be protected" with that code.
The main cells I am trying to protect do not have formulas...is there anything else than could be done?
Thanks.
hi,
I think it's not the best way but I use
(it's just an option)
and for example a commandbutton in a userform![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Regards, John55
If you have issues with Code I've provided, I appreciate your feedback.
In the event Code provided resolves your issue, please mark your Thread as SOLVED.
If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.
...enjoy -funny parrots-
Hi john55,
Thanks for the code, seems to be working well.
The only problem is that if I would like to make any changes, would I have to go into the codes and take them out?? Or can this be done through a password because when I enter the password it is not recognised. I have copied your code the way it is but I get the following msg:
"The password you supplied is incorrect. Verify the CAPS LOCK key is off and be sure to use the correct capitalization".
I am entering "1234" but I don't know why this error is occuring.
Thanks.
hi
I use this method to control the workbook( see the test file attached). depends what you want...just try to play with it.
so, commandbutton4 contains something that you want to do in yr workbook but the code I suggested you unprotect, execute and then protect!
then this is the button for unprotect
you can hide/unhide it using![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Last edited by john55; 11-12-2011 at 08:33 AM.
Hi john55,
Code seems to be working well, thanks for your help!
Glad it helped
![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks