ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Lock Cell After Data is Entered on Particular Cell (https://www.excelbanter.com/excel-worksheet-functions/446409-lock-cell-after-data-entered-particular-cell.html)

Moideen

Lock Cell After Data is Entered on Particular Cell
 
We are maintaing an excel sheet for expense details, After Entering the data on Amount Coloumn Need to Lock The Amount Coloumn with Password.
Please help me.

Coloumn 1 Coloumn 2 Coloumn 3

Date Item Name Amount

WoolyBully

Lock Cell After Data is Entered on Particular Cell
 
On Sun, 24 Jun 2012 12:00:21 +0000, Moideen
wrote:


We are maintaing an excel sheet for expense details, After Entering the
data on Amount Coloumn Need to Lock The Amount Coloumn with Password.
Please help me.

Coloumn 1 Coloumn 2 Coloumn 3

Date Item Name Amount



Unlock cell, add data, re-lock cell.

All has to be by code. No auto-function for this. You must visit the
programming sub-group.

Gord Dibben[_2_]

Lock Cell After Data is Entered on Particular Cell
 
First...........select all cells on sheet and format them to unlocked.

Add this event code to the worksheet module.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 3 Then
ActiveSheet.Unprotect Password:="justme"
n = Target.Row
If Me.Range("C" & n).Value < "" Then
Me.Range("C" & n).Locked = True
End If
End If
enditall:
ActiveSheet.Protect Password:="justme"
Application.EnableEvents = True
End Sub

When you enter a value in column C that cell will become locked for
editing.


Gord


On Sun, 24 Jun 2012 12:00:21 +0000, Moideen
wrote:


We are maintaing an excel sheet for expense details, After Entering the
data on Amount Coloumn Need to Lock The Amount Coloumn with Password.
Please help me.

Coloumn 1 Coloumn 2 Coloumn 3

Date Item Name Amount


CellShocked

Lock Cell After Data is Entered on Particular Cell
 
On Sun, 24 Jun 2012 07:08:06 -0700, Gord Dibben wrote:

First...........select all cells on sheet and format them to unlocked.

Add this event code to the worksheet module.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 3 Then
ActiveSheet.Unprotect Password:="justme"
n = Target.Row
If Me.Range("C" & n).Value < "" Then
Me.Range("C" & n).Locked = True
End If
End If
enditall:
ActiveSheet.Protect Password:="justme"
Application.EnableEvents = True
End Sub

When you enter a value in column C that cell will become locked for
editing.


Gord


On Sun, 24 Jun 2012 12:00:21 +0000, Moideen
wrote:


We are maintaing an excel sheet for expense details, After Entering the
data on Amount Coloumn Need to Lock The Amount Coloumn with Password.
Please help me.

Coloumn 1 Coloumn 2 Coloumn 3

Date Item Name Amount



Still seems quite vulnerable.

Gord Dibben[_2_]

Lock Cell After Data is Entered on Particular Cell
 
On Sun, 24 Jun 2012 07:31:47 -0700, CellShocked
<cellshocked@thecellvalueattheendofthespreadsheet. org wrote:

Still seems quite vulnerable.


In what manner other than the weakness of Excel's internal security
which is always the issue.

OP can lock the project from viewing so's users cannot see the
password.


Gord



GS[_2_]

Lock Cell After Data is Entered on Particular Cell
 
How would the user edit an incorrect entry in the amount column?

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



Moideen

Quote:

Originally Posted by Gord Dibben[_2_] (Post 1603079)
First...........select all cells on sheet and format them to unlocked.

Add this event code to the worksheet module.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 3 Then
ActiveSheet.Unprotect Password:="justme"
n = Target.Row
If Me.Range("C" & n).Value < "" Then
Me.Range("C" & n).Locked = True
End If
End If
enditall:
ActiveSheet.Protect Password:="justme"
Application.EnableEvents = True
End Sub

When you enter a value in column C that cell will become locked for
editing.


Gord


On Sun, 24 Jun 2012 12:00:21 +0000, Moideen
wrote:


We are maintaing an excel sheet for expense details, After Entering the
data on Amount Coloumn Need to Lock The Amount Coloumn with Password.
Please help me.

Coloumn 1 Coloumn 2 Coloumn 3

Date Item Name Amount

Dear Gord ,

Thank you very much, It's Function working well, But i unprotected the work sheet with the password of "justme" and excel opening time need auto protection if i forgot to protect the sheet before excel closing time.
your kindly help is highly appreciated

Gord Dibben[_2_]

Lock Cell After Data is Entered on Particular Cell
 
On Mon, 25 Jun 2012 12:29:45 +0000, Moideen
wrote:

Dear Gord ,

Thank you very much, It's Function working well, But i unprotected the
work sheet with the password of "justme" and excel opening time need
auto protection if i forgot to protect the sheet before excel closing
time.
your kindly help is highly appreciated


Copy/paste this event code to Thisworkbook module.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets("yoursheetname").Protect Password:="justme"
End Sub

NOTE: as others have pointed out, Excel's internal security is quite
weak and protection of cells and sheets will serve only to prevent
accidental overwriting of formulas or data.

A user determined to change data can easily crack the password
protection.

GS also asked "how will user correct a mistake in data entry if cells
are locked"?

What will you do if users do not enable VBA when they open the
workbook?

Have you considered these issues?


Gord

Moideen

Quote:

Originally Posted by Gord Dibben[_2_] (Post 1603139)
On Mon, 25 Jun 2012 12:29:45 +0000, Moideen
wrote:

Dear Gord ,

Thank you very much, It's Function working well, But i unprotected the
work sheet with the password of "justme" and excel opening time need
auto protection if i forgot to protect the sheet before excel closing
time.
your kindly help is highly appreciated


Copy/paste this event code to Thisworkbook module.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets("yoursheetname").Protect Password:="justme"
End Sub

NOTE: as others have pointed out, Excel's internal security is quite
weak and protection of cells and sheets will serve only to prevent
accidental overwriting of formulas or data.

A user determined to change data can easily crack the password
protection.

GS also asked "how will user correct a mistake in data entry if cells
are locked"?

What will you do if users do not enable VBA when they open the
workbook?

Have you considered these issues?


Gord

Dear Gord,

Thank you once again for your quick response,We are not facing these types of issues, Because this is not a highly important file.

Jimmy Duncan

[quote='Gord Dibben[_2_];1603079']First...........select all cells on sheet and format them to unlocked.

Add this event code to the worksheet module.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 3 Then
ActiveSheet.Unprotect Password:="justme"
n = Target.Row
If Me.Range("C" & n).Value < "" Then
Me.Range("C" & n).Locked = True
End If
End If
enditall:
ActiveSheet.Protect Password:="justme"
Application.EnableEvents = True
End Sub

When you enter a value in column C that cell will become locked for
editing.


Gord


Hello Gord,

The cells I want to lock are already unlocked in a protected worksheet and the above code works perfect for column C. I have a need to do the same thing on columns A thru N. How is the above code modified to do this?

Many thanks,

Jim

[email protected]

Lock Cell After Data is Entered on Particular Cell
 
On Sunday, June 24, 2012 5:30:21 PM UTC+5:30, Moideen wrote:
We are maintaing an excel sheet for expense details, After Entering the
data on Amount Coloumn Need to Lock The Amount Coloumn with Password.
Please help me.

Coloumn 1 Coloumn 2 Coloumn 3

Date Item Name Amount




--
Moideen


Dear all,

i want to lock the excel spread sheet after cell entry , (lock the cells one by one )

[email protected]

Lock Cell After Data is Entered on Particular Cell
 
On Sunday, June 24, 2012 7:38:06 PM UTC+5:30, Gord Dibben wrote:
First...........select all cells on sheet and format them to unlocked.

Add this event code to the worksheet module.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 3 Then
ActiveSheet.Unprotect Password:="justme"
n = Target.Row
If Me.Range("C" & n).Value < "" Then
Me.Range("C" & n).Locked = True
End If
End If
enditall:
ActiveSheet.Protect Password:="justme"
Application.EnableEvents = True
End Sub

When you enter a value in column C that cell will become locked for
editing.


Gord


On Sun, 24 Jun 2012 12:00:21 +0000, Moideen
wrote:


We are maintaing an excel sheet for expense details, After Entering the
data on Amount Coloumn Need to Lock The Amount Coloumn with Password.
Please help me.

Coloumn 1 Coloumn 2 Coloumn 3

Date Item Name Amount


Thanks , i need one more clarifications. once entered the data in cell give the lock of each column respective row.

if possible please post.

thank you for the support

[email protected]

Lock Cell After Data is Entered on Particular Cell
 
i want cell lock after input automatically in google drive....

can any one send the process....

[email protected]

Lock Cell After Data is Entered on Particular Cell
 
On Sunday, 24 June 2012 19:38:06 UTC+5:30, Gord Dibben wrote:
First...........select all cells on sheet and format them to unlocked.

Add this event code to the worksheet module.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 3 Then
ActiveSheet.Unprotect Password:="justme"
n = Target.Row
If Me.Range("C" & n).Value < "" Then
Me.Range("C" & n).Locked = True
End If
End If
enditall:
ActiveSheet.Protect Password:="justme"
Application.EnableEvents = True
End Sub

When you enter a value in column C that cell will become locked for
editing.


Gord


On Sun, 24 Jun 2012 12:00:21 +0000, Moideen
wrote:


We are maintaing an excel sheet for expense details, After Entering the
data on Amount Coloumn Need to Lock The Amount Coloumn with Password.
Please help me.

Coloumn 1 Coloumn 2 Coloumn 3

Date Item Name Amount


Hey Gord, I'm managing a google sheet which is shared with the staff of my cousin's hotel and I've to lock the sheet in order to restrict them from editing the pre-existing data of the sheet afterwards but let them add data into the sheet. Is there a way to get these thing automatically done and still let them to add details?
I don't need the sheet to password protected.

GS[_6_]

Lock Cell After Data is Entered on Particular Cell
 
On Sunday, 24 June 2012 19:38:06 UTC+5:30, Gord Dibben wrote:
First...........select all cells on sheet and format them to unlocked.

Add this event code to the worksheet module.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 3 Then
ActiveSheet.Unprotect Password:="justme"
n = Target.Row
If Me.Range("C" & n).Value < "" Then
Me.Range("C" & n).Locked = True
End If
End If
enditall:
ActiveSheet.Protect Password:="justme"
Application.EnableEvents = True
End Sub

When you enter a value in column C that cell will become locked for
editing.


Gord


On Sun, 24 Jun 2012 12:00:21 +0000, Moideen
wrote:


We are maintaing an excel sheet for expense details, After Entering the
data on Amount Coloumn Need to Lock The Amount Coloumn with Password.
Please help me.

Coloumn 1 Coloumn 2 Coloumn 3

Date Item Name Amount


Hey Gord, I'm managing a google sheet which is shared with the staff of my
cousin's hotel and I've to lock the sheet in order to restrict them from
editing the pre-existing data of the sheet afterwards but let them add data
into the sheet. Is there a way to get these thing automatically done and
still let them to add details? I don't need the sheet to password protected.


Google Sheets is not Excel; it's their own app! They do provide a very good
online help so look there first.

Essentially, though, set the user input cells "Locked" property to inlocked,
then protect the sheet. Usually, using the 'Tab' key will navigte from input
cell to input cell if protection allows to not select locked cells.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion

[email protected]

Lock Cell After Data is Entered on Particular Cell
 
On Sunday, June 24, 2012 at 5:30:21 PM UTC+5:30, Moideen wrote:
We are maintaing an excel sheet for expense details, After Entering the
data on Amount Coloumn Need to Lock The Amount Coloumn with Password.
Please help me.

Coloumn 1 Coloumn 2 Coloumn 3

Date Item Name Amount




--
Moideen


Dear Sir,

I want to lock the cells after editing couple of ranges. is it posible to lock the cell after edit the range i.e. A:A. and locked the cell after 2 hours automatically.

Jennifer[_11_]

Lock Cell After Data is Entered on Particular Cell
 
On Sunday, June 24, 2012 at 10:08:06 AM UTC-4, Gord Dibben wrote:
First...........select all cells on sheet and format them to unlocked.

Add this event code to the worksheet module.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 3 Then
ActiveSheet.Unprotect Password:="justme"
n = Target.Row
If Me.Range("C" & n).Value < "" Then
Me.Range("C" & n).Locked = True
End If
End If
enditall:
ActiveSheet.Protect Password:="justme"
Application.EnableEvents = True
End Sub

When you enter a value in column C that cell will become locked for
editing.


Gord


On Sun, 24 Jun 2012 12:00:21 +0000, Moideen
wrote:


We are maintaing an excel sheet for expense details, After Entering the
data on Amount Coloumn Need to Lock The Amount Coloumn with Password.
Please help me.

Coloumn 1 Coloumn 2 Coloumn 3

Date Item Name Amount


Gord,

If you can, I need similar, but slightly different help. I need to lock cells in a specific column, but only after the value of the column has been changed to a specific value.

We have a buyer sheet that we've been having issues with buyers changing their minds after they've already adjusted an item status from "Hold" to "Ready to Use" and we would like to be able to lock that column once the value is changed to "Ready to Use" but editable prior to that change.

Is there someway of doing that?

-Jennifer

Faizan Khan

Lock Cell After Data is Entered on Particular Cell
 
On Sunday, June 24, 2012 at 5:30:21 PM UTC+5:30, Moideen wrote:
We are maintaing an excel sheet for expense details, After Entering the
data on Amount Coloumn Need to Lock The Amount Coloumn with Password.
Please help me.

Coloumn 1 Coloumn 2 Coloumn 3

Date Item Name Amount




--
Moideen



Hi Guys,

This code works fine.

But I need to lock cell whenever it gets edited.

for example if I edit A1 than after editing A1 needs password to edit again similarly to other cells.


[email protected]

Lock Cell After Data is Entered on Particular Cell
 
On Thursday, January 18, 2018 at 9:06:10 AM UTC+3, Faizan Khan wrote:
On Sunday, June 24, 2012 at 5:30:21 PM UTC+5:30, Moideen wrote:
We are maintaing an excel sheet for expense details, After Entering the
data on Amount Coloumn Need to Lock The Amount Coloumn with Password.
Please help me.

Coloumn 1 Coloumn 2 Coloumn 3

Date Item Name Amount




--
Moideen



Hi Guys,

This code works fine.

But I need to lock cell whenever it gets edited.

for example if I edit A1 than after editing A1 needs password to edit again similarly to other cells.




All times are GMT +1. The time now is 03:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com