Partial protection?

S

StressMonkey

I have a spreadsheet that I want to be read only. But it has a funtion in
the first cell that when you click on it, it will sort for you one of 6
different ways. I can't protect the sheet cause then you can't sort. But I
don't want anyone to change what's in the cells. Is this possible at all?

Thanks,
StressMonkey
 
D

Dave Peterson

You could have your macro that does the sorting unprotect the sheet, sort the
data, and reprotect the sheet????
 
P

Puppet_Sock

StressMonkey said:
I have a spreadsheet that I want to be read only. But it has a funtion in
the first cell that when you click on it, it will sort for you one of 6
different ways. I can't protect the sheet cause then you can't sort. But I
don't want anyone to change what's in the cells. Is this possible at all?

Sure. It's not bullet proof, though. You can always hack around
and get by such stuff.

What you do is make some VBA code that unlocks the sheet
(or the parts that you need unlocked), does the sort, then
relocks it. It's pretty easy to find out what sort of VBA you need
to write by using a spreadsheet just to test stuff, and record
the actions of protecting a sheet, then unprotecting it.

So, the user clicks a button, the code does the unlock, does
the work, then does the lock. If you want to get fancy, you
can detect the user changing selection on cells, and do the
work on that basis.

Also, you can specify certain cells be locked, and others not.
That way, you can have areas the user can type in, and others
that can't be.
Socks
 
Top