View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Sriram Sriram is offline
external usenet poster
 
Posts: 50
Default NEED HELP - How to disable a cell to restrict data entry

Dear Tom,

Thanks for your prompt reply. I'm trying for that and let you know about its
functionality soon.

Now I've come up to you with another query. Kindly help me out ATE.

I want the last line of the sheet to go down automatically if its previous
line is entered with data.

For example, my last line is in 20th row which will be filled with "*"
(stars). If the user enters in the first column in the 19th row then
automatically the 20th row having "* stars should go down to 21st row and the
20th row should get blank and should be ready for the user to enter the data.

Again if the user enters the data in the first column of the 20th row, then
the 21st row (which contains "*" stars) shouldgo down one row below and the
21st row should be blank and ready for the user to enter data.

Kindly help me to achieve this ASAP.

Thanks and Regards,
Sriram

"Tom Ogilvy" wrote:

Sounds like you are already familiar with the Change Event.

(right click on the sheet tab and select view code, then place this in the
resulting module if you don't have one or add similar code to your existing
change event.)

Private Sub Worksheet_Change(ByVal Target As Range)
If target.count 1 then exit sub
if target.column = 3 then
if trim(lcase(target.value)) = "completed" then
me.unprotect password:="ABC"
target.locked = True
me.Protect password:="ABC"
end if
End if
End Sub

Since your sheet will be protected, make sure that any cells that you want
to allow entries in are formatted as Unlocked. Change Column = 3 to
reflect the column number of the column where you want this behavior.

--
Regards,
Tom Ogilvy

"Sriram" wrote:

Dear Friends,

I need to disable one or more cells, so that the user can not enter any data
in those field(s), when the respective cell's value meets some condition.

For example, if the column heading is say "Pending Job" and its entries will
be either "Pending" or "Completed". This will be selected by the user in the
form of List, so he can't enter anything other than these two. Once he
selected the cell's value as "Completed", then that particular cell should be
Disabled, so that in future he can't change it again to "Pending".

Kindly help me how to achieve this by means of Macro codings, because I amde
the whole file's data and its results are controlled by Macro codings.

Kindly help me ASAP.

Thanks and Regards,
Sriram S