Excel question

marine1

Honorary Master
Joined
Sep 4, 2006
Messages
49,491
Hey guys need some help please.

I am doing a workbook where its just a basic thing, entering Rands and dollar amounts in every line.

What I want to do is, once I enter the number and am happy its checked, I want to lock that particular cell so I cannot by mistake edit it.
There will be many entries throughout the day and dont want to have to reconcile at the end when there is a mistake

Please could you help?

Thanks
 

TheMightyQuinn

Not amused...
Joined
Oct 6, 2010
Messages
31,961
1.Navigate to the Review tab.
2.Click Protect Sheet. ...
3.Click OK to protect the sheet.
4.Select all the cells you don't want to be locked. ...
5.Right-click on your selection, select Format Cells, and click on the Protection tab. ...
6.Uncheck "Locked" (which is checked by default) and click OK.
 

Nod

Honorary Master
Joined
Jul 22, 2005
Messages
10,057
What I want to do is, once I enter the number and am happy its checked, I want to lock that particular cell so I cannot by mistake edit it.
There will be many entries throughout the day and dont want to have to reconcile at the end when there is a mistake

You can only lock a whole sheet.
However, before you lock the sheet, you can select cells to keep unlocked. Then, when you lock the sheet, you may still edit those cells.

In your case, you will have to:
1. Select all the cells you would want to work on
2. Unlock them, then lock the sheet
3. Make changes to a few cells, then
4. Unlock the sheet
5. Lock the cells you are happy with, and then lock the sheet again

It is going to be a schlep, but I have not found another per cell option.
 

hawker

Honorary Master
Joined
Sep 22, 2006
Messages
11,461
Select all the cells -> format cells -> protection -. Untick locked.

Then whenever you finish a row you select the cells you want -> format cells -> make sure locked is ticked.

Then go to Review tab and choose "protect sheet" - you can leave the password field blank.

Then when you want to lock changes just repeat the above process for the next rows.
 

isie

Honorary Master
Joined
Jan 16, 2010
Messages
12,604
Hey guys need some help please.

I am doing a workbook where its just a basic thing, entering Rands and dollar amounts in every line.

What I want to do is, once I enter the number and am happy its checked, I want to lock that particular cell so I cannot by mistake edit it.
There will be many entries throughout the day and dont want to have to reconcile at the end when there is a mistake

Please could you help?

Thanks

Not sure if this will help - found it on MS help a while ago when i needed something similar
highlight the entire worksheet click on format and go to protection untick locked click OK
then right click on the sheet choose view code paste the below in and pres alt q -
if you need to edit again right click on sheet and choose unprotect and insert password (default is secret - so change it before rpastign to what you want)


Private Sub Worksheet_Change(ByVal Target As Range)
Dim cel As Range
ActiveSheet.Unprotect ' Password:="secret"
For Each cel In Target
If cel.Value <> "" Then
cel.Locked = True
End If
Next cel
ActiveSheet.Protect ' Password:="secret"
End Sub
 

marine1

Honorary Master
Joined
Sep 4, 2006
Messages
49,491
Thanks guys,
Isnt it a bit stupid ?
You cannot lock a cell as you go on?

Seems like a simple thing to do :confused:
 

isie

Honorary Master
Joined
Jan 16, 2010
Messages
12,604
Thanks guys,
Isnt it a bit stupid ?
You cannot lock a cell as you go on?

Seems like a simple thing to do :confused:

not a default setting unfortunately - have you tried the script i advised just tested it now and it works only allows you to type once in a cell and then locks it
 

Batista

Executive Member
Joined
Sep 2, 2011
Messages
7,909
Thanks guys,
Isnt it a bit stupid ?
You cannot lock a cell as you go on?

Seems like a simple thing to do :confused:

With the code posted you probably can.Otherwise manually lock each cell after clicking it.
 
Top