Hi, I have a big block of data in a sheet. I want that block and only that block protected. It saved as locked, and protected. I have a macro that uses the data, and in the code I stipulate that it first unprotect the sheet and unlock ALL the cells in the worksheet (in case some other user had for some reason put a lock on unused cells. The macro does what it has to do, and at the end selects the range of used cells, and locks them and protects them.
I tested this by choosing a blank cell and locking it, then running the code. Theoretically, when the entire cell range is selected and unlocked, this cell should be unlocked as well. Then, at the end of the macro, when the data block is selected, and locked, and protected, the blank cell that had been locked and protected before should be unlocked. I ran the macro, and tried to type in the blank cell, and it wouldn't let me. For some reason it stayed locked at the end of the code. Anyone know why?
Here's what I have at the beginning of the code to unlock and unprotect:
And at the end to lock the cells I want and protect them:
I'll refrain from posting the entire code because it's kind of long
Bookmarks