Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Kev Nurse
 
Posts: n/a
Default How do I protect work sheet against the "Delete" function?

I have a shared worksheet full of textual data (names). I want the users to
be able to freely move the data around the sheet by simple pointer movement
or through cut and paste. However, deleting any data (even if immediate
re-entering elsewhere is intended) must not be allowed in any circumstance.

Is this possible? If so, how?

Thanks

Kevin Nurse


  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

If I had to do this, I think I'd provide a macro that did exactly what I wanted
done and no more. I'd protect the worksheet and then ask the user to select the
from range and to range and do the copy in code (also unprotecting and then
reprotecting the worksheet).

But worksheet protection isn't very strong. It can be broken by anyone who can
find these newsgroups.

You could add more validity checks to this.

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim RngF As Range
Dim RngT As Range
Dim myPwd As String

myPwd = "hi"

Set wks = Worksheets("sheet1")

Set RngF = Nothing
On Error Resume Next
Set RngF = Application.InputBox(prompt:="Pick your From Range", _
Type:=8).Areas(1)
On Error GoTo 0

If RngF Is Nothing Then
Exit Sub
End If

If RngF.Parent.Name < wks.Name Then
MsgBox "Has to be on to be on worksheet: " & wks.Name
Exit Sub
End If

Set RngT = Nothing
On Error Resume Next
Set RngT = Application.InputBox _
(prompt:="Pick the top left cell of your To Range", _
Type:=8).Cells(1)
On Error GoTo 0

If RngT Is Nothing Then
Exit Sub
End If

If RngT.Parent.Name < wks.Name Then
MsgBox "Has to be on to be on worksheet: " & wks.Name
Exit Sub
End If

wks.Unprotect Password:=myPwd
RngF.Cut _
Destination:=RngT
wks.Protect Password:=myPwd

End Sub


Kev Nurse wrote:

I have a shared worksheet full of textual data (names). I want the users to
be able to freely move the data around the sheet by simple pointer movement
or through cut and paste. However, deleting any data (even if immediate
re-entering elsewhere is intended) must not be allowed in any circumstance.

Is this possible? If so, how?

Thanks

Kevin Nurse


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Work Sheet Comments Evans-DC Excel Worksheet Functions 5 February 9th 05 10:39 PM
Variable validation-password protect sheet Marty Excel Worksheet Functions 0 January 26th 05 02:27 PM
Do you have a work in progress sheet Admarkian Charts and Charting in Excel 0 January 6th 05 04:13 AM
how is possible working on work sheet by two person in the netwo. Ben Excel Worksheet Functions 1 November 18th 04 02:39 AM
Naming & renaming a sheet tab Cgbilliar Excel Worksheet Functions 1 November 7th 04 05:57 PM


All times are GMT +1. The time now is 11:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"