Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default use source formatting with protected worksheet

I have created a spreadsheet with multiple complex formulas. I protected the
worksheet , but allowed the end user to copy and paste protected cells into
unprotected cells. When I do this the source protected cells are no longer
protected, its useing the destination formating not the source formatting.
Is there anyway around this?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default use source formatting with protected worksheet

When a sheet is protected you cannot change formatting of the destination
cells simply by pasting source cells that are locked.

You would have to use event code to unprotect, paste cells with formatting
then re-protect

Something like this which is slow on large selections.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng1 As Range
Set rng1 = Selection
rng1.Copy
ActiveSheet.Unprotect
rng1.Copy Destination:=ActiveCell
ActiveSheet.Protect
End Sub


Gord Dibben MS Excel MVP


On Tue, 22 Jul 2008 05:33:00 -0700, NDORengineer
wrote:

I have created a spreadsheet with multiple complex formulas. I protected the
worksheet , but allowed the end user to copy and paste protected cells into
unprotected cells. When I do this the source protected cells are no longer
protected, its useing the destination formating not the source formatting.
Is there anyway around this?


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default use source formatting with protected worksheet

And the reason it runs slow is because I forgot to disable events.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng1 As Range
Set rng1 = Selection
rng1.Copy
ActiveSheet.Unprotect
Application.EnableEvents = False
rng1.Copy Destination:=ActiveCell
ActiveSheet.Protect
Application.EnableEvents = True
End Sub


Gord

On Tue, 22 Jul 2008 09:42:15 -0700, Gord Dibben <gorddibbATshawDOTca wrote:

When a sheet is protected you cannot change formatting of the destination
cells simply by pasting source cells that are locked.

You would have to use event code to unprotect, paste cells with formatting
then re-protect

Something like this which is slow on large selections.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng1 As Range
Set rng1 = Selection
rng1.Copy
ActiveSheet.Unprotect
rng1.Copy Destination:=ActiveCell
ActiveSheet.Protect
End Sub


Gord Dibben MS Excel MVP


On Tue, 22 Jul 2008 05:33:00 -0700, NDORengineer
wrote:

I have created a spreadsheet with multiple complex formulas. I protected the
worksheet , but allowed the end user to copy and paste protected cells into
unprotected cells. When I do this the source protected cells are no longer
protected, its useing the destination formating not the source formatting.
Is there anyway around this?


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
Edit text format in non-protected cells in protected worksheet Bonnie Excel Discussion (Misc queries) 2 April 19th 08 04:48 PM
Preventing formatting changes in a protected worksheet Singh Excel Discussion (Misc queries) 0 January 30th 08 05:16 PM
Linking to Protected Source File on Shared Server hspence Setting up and Configuration of Excel 0 February 20th 07 08:45 PM
How can I have formatting toolbar active for the unprotected(unlocked) cells of the protected worksheet??? sanam Excel Discussion (Misc queries) 6 July 20th 06 01:42 PM
Change Source of Link in Protected Sheet Chiku Excel Discussion (Misc queries) 0 December 22nd 05 06:37 PM


All times are GMT +1. The time now is 11:40 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"