how to lock worksheet from myself!!

iknowu99

Well-known Member
Joined
Dec 26, 2004
Messages
1,158
I am running a Macro and sometimes it accesses worksheets and looks up values - this is good. But sometimes it changes values in worksheets - no good
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
If it's changing values, that can only be because you told it to. Either you are writing new formulas, or copying and pasting in an unintended location. You could also be copying cells with formulas and pasting them in a different context. This will change the results of those calculations.

If you post your code, we can give you more specific guidance.

Denis
 
Upvote 0
Hello Denis from Sydney, how's the weather over there?

This is the truth - it sometimes happens and I would like to know if there's a way for my code to be read only on some sheets. And the code is 40 pages long and top secret :P
 
Upvote 0
Go to Tools -> Protection -> Allow Users to Edit Ranges

here u can specify cells which can be unlocked using password in a protected sheet

Then

Go to Tools -> Protection -> protect sheet
This locks all the cells in the given sheet,
only the cells u have specified previously can be unlocked using password !!

Probably this helps!
 
Upvote 0
Your code is 'top secret'?

If it is then I don't see how we can help you.

As Denis pointed out the code will only do what you 'tell' it.

BTW 40 pages long?

Sounds like somethings not quite right.:)
 
Upvote 0
hsk, you hit the spot

norie, if i reveal my code you will be the first one to see it :)

thanks guys
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,383
Members
448,956
Latest member
JPav

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top