View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.worksheet.functions
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default 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