View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JP[_4_] JP[_4_] is offline
external usenet poster
 
Posts: 897
Default Disallow cell data entry which autopopulates

You didn't say what Excel version you are using. In Excel 2003, you
would lock the cells you want to protect, and unlock the ones you want
the user to edit. Then you would protect the worksheet in the
Workbook_Open event, with additional code to allow only macros to make
changes to the locked cells.

1. Select cells you don't want to be changed (i.e. B1), press Ctrl-1,
go to Protection tab, check "Locked" and "Hidden"
2. Select cells you want to allow editing, press Ctrl-1, go to
Protection tab, UNcheck "Locked" and "Hidden"
3. Go to ToolsProtectionProtect SheetOK.

Now all the cells you marked in step 2 will be editable, while the
ones you selected in step 1 will be uneditable (and the formulas will
be hidden as well).

This code, placed in the ThisWorkbook module, will protect your sheets
and allow your update macro to run on the locked cells. See
http://www.rondebruin.nl/code.htm for implementation help.

Private Sub Workbook_Open()
Dim ws As Excel.Worksheet
For Each ws In Worksheets
ws.Protect Password:="mypassword", UserInterFaceOnly:=True
Next ws
End Sub


HTH,
JP


On Feb 19, 1:57*pm, jackel
wrote:
I have a macro which autopopulates a date/time stamp (lets say,cell B1)
when a selection is chosen in (A1). This time stamp can be changed and
I don't want anyone to be able to change it. I want to make the cell
where the user can click the cell, but when they try to type, nothing
happens.

Thanks,

--
jackel