Currently I have this code, but it's not working. I'm not sure what to use to lock an entire row. Seems like this would do it.
![]()
Please Login or Register to view this content.
Currently I have this code, but it's not working. I'm not sure what to use to lock an entire row. Seems like this would do it.
![]()
Please Login or Register to view this content.
Last edited by kid_epicurus; 04-19-2012 at 04:27 PM.
How about this:
![]()
Please Login or Register to view this content.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
I'm still able to make edits to the row using that code. :/
Maybe it's objecting to the Value = True part
See if this works
![]()
Please Login or Register to view this content.
Last edited by arlu1201; 04-21-2012 at 02:22 PM. Reason: Use code tags.
No, the code I gave is correct. I'm going to guess he hasn't PROTECTED his worksheet yet. The Locked = True/False setting only "applies" when you protect your worksheet.
If you're going to have macros making changes to your protected worksheets, you'll have to specifically unprotect and reprotect, too.
![]()
Please Login or Register to view this content.
Ah ok. Didn't know worksheets had to be protected in order to lock/unlock rows. Weird.
Seems like they'd have an option to just lock a row without having an entire workbook protected. Especially since I just need to lock down one row at a time and don't need the entire workbook locked down.
Thanks!
Nah, not weird at all. And you do have the option to lock just a row and not the entire sheet (not workbook, just the sheet). If you first set all the cells on a sheet to UNLOCKED, the specifically set the rows to locked that you want, when you then lock the sheet.... those are the only cells locked.
You do understand that there has to be a state in which no cells are locked... think of it as Design Mode, then you flip the switch to activate the locks on appropriate cells all at once. That's why it works this way.
And there is a difference between a sheet being protected and an entire workbook being protected, too.
If that takes care of your need, please click Thread Tools above your first post and mark this thread as SOLVED.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks