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

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
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
 

iknowu99

Well-known Member
Joined
Dec 26, 2004
Messages
1,158
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
 

hsk

Well-known Member
Joined
Oct 19, 2006
Messages
567
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!
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,300
Office Version
  1. 365
Platform
  1. Windows
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.:)
 

iknowu99

Well-known Member
Joined
Dec 26, 2004
Messages
1,158
hsk, you hit the spot

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

thanks guys
 

Forum statistics

Threads
1,136,268
Messages
5,674,734
Members
419,523
Latest member
Urnovio

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
Top