PC Review


Reply
Thread Tools Rate Thread

Allowing input, but restricting deletion

 
 
innovate
Guest
Posts: n/a
 
      7th Jun 2007
Hi all,

Is it possible to allow input into a spreadsheet, but at the same time
making sure that data that is inputted is impossible to delete?

Hope you guys can help,
Roland

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      7th Jun 2007
You may be able to do something with some sort of worksheet event. But I'd be
worried about typos. How would you go about fixing those if the cell was locked
after I finished my initial input?

innovate wrote:
>
> Hi all,
>
> Is it possible to allow input into a spreadsheet, but at the same time
> making sure that data that is inputted is impossible to delete?
>
> Hope you guys can help,
> Roland


--

Dave Peterson
 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      7th Jun 2007
Not without some event code that would prevent the deletion after input.

Right-click on the sheet tab and "View Code".

Copy/paste the code into that module.

Alt + q to return to Excel window.

CTRL + a to select all cells.

Format>Cells>Protection........uncheck "locked"

As written, the event code will operate on any cell in columns A to lock the
cell after data input. Options for other ranges can be provided to suit.

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

To prevent users from seeing the code and password, protect the project from
viewing.

Alt + F11 to open Visual Basic Editor.

Select your workbook/project and right-click>VBAProject
Properties>Protection>Lock for Viewing. Apply a password and save/close the
workbook.

When re-opened, code will be unviewable or uneditable.


Gord Dibben MS Excel MVP

On Thu, 07 Jun 2007 10:56:30 -0700, innovate <(E-Mail Removed)> wrote:

>Hi all,
>
>Is it possible to allow input into a spreadsheet, but at the same time
>making sure that data that is inputted is impossible to delete?
>
>Hope you guys can help,
>Roland


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Allowing row deletion in worksheet with locked cells MT Microsoft Excel Misc 2 16th Jul 2009 04:06 AM
Restricting deletion HRM Microsoft Outlook Installation 2 4th Jun 2009 06:55 PM
Restricting Deletion to One record only in a Subform \Roshan Abbasi via AccessMonster.com\ Microsoft Access Forms 2 5th Jul 2005 12:46 PM
not allowing changes to input field once input has been made. dale Microsoft Outlook Form Programming 10 8th Jun 2004 02:48 PM
System not allowing deletion of Spyware File Mike Windows XP Security 1 17th Dec 2003 08:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:16 AM.