Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Protected Excel Worksheet

I have an Excel worksheet that contains questions, the cells with the
questions have been protected to prevent users from changing the
questions. The users are to type the answer in the cell beside the
question (I.E. question in protected cell A1 answer goes in
unprotected cell A2). However, if a user copies the answer from
another document and pastes the answer into cell A2 the information is
then protected and does allow them to change the answer that was
pasted into cell A2. Can someone explain why this is happening?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Protected Excel Worksheet

When the user copies|pastes, then the user is copying the cell and all its
attributes--including the locked-ness of that copied cell.

You could try to tell the user to paste to (and probably copy from) the address
bar. Then the cell's attributes aren't copied.

You could also have an macro that fires when the user makes a change. This
event macro would change the locked property back to what you want.

If you want to try, then rightclick on the worksheet tab that should have this
behavior. Select view code and paste this into the newly opened code window:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim RngToUnlock As Range
Dim myIntersect As Range
Dim PWD As String

PWD = "hi"

'whatever that range is...
Set RngToUnlock = Me.Range("A2:a9,c3:d92,e:e,j:M")

Set myIntersect = Intersect(Target, RngToUnlock)

If myIntersect Is Nothing Then
Exit Sub
End If

Me.Unprotect Password:=PWD
myIntersect.Locked = False
Me.Protect Password:=PWD

End Sub

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

======
Be aware that most macros will kill the undo/redo stack.



wrote:

I have an Excel worksheet that contains questions, the cells with the
questions have been protected to prevent users from changing the
questions. The users are to type the answer in the cell beside the
question (I.E. question in protected cell A1 answer goes in
unprotected cell A2). However, if a user copies the answer from
another document and pastes the answer into cell A2 the information is
then protected and does allow them to change the answer that was
pasted into cell A2. Can someone explain why this is happening?


--

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; tabbing through protected worksheet rvtrails Excel Discussion (Misc queries) 2 December 19th 09 08:20 PM
Edit text format in non-protected cells in protected worksheet Bonnie Excel Discussion (Misc queries) 2 April 19th 08 04:48 PM
How can I do a "Save As" on a protected excel worksheet Janedola Excel Worksheet Functions 0 April 22nd 05 02:06 AM
spell check for protected worksheet for Excel 97 Jessica Excel Discussion (Misc queries) 1 March 18th 05 05:48 PM
How do i delete a row in a excel worksheet that is protected jim Excel Worksheet Functions 3 March 7th 05 08:05 PM


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

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

About Us

"It's about Microsoft Excel"