Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default copy to protected sheet

Unprotect it first, do the copy, then protect it again.

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"bob" wrote in message
. ca...
i am trying to copy to a range of unprotected cells in a protected sheet.
the following will give an error after paste if destination sheet is
protected.
what copy statement would work
thanks

' copy from data to test
Range("A1:P350").Select
Selection.Copy
Sheets("test").Select
Range("W8").Select
ActiveSheet.Paste


' add autofilter back
Range("W12:AL12").Select
Application.CutCopyMode = False
Selection.AutoFilter

End Sub




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default copy to protected sheet

Or protect you sheets with code like this
in the Workbook open event of the Thisworkbook module

Private Sub Workbook_Open()
Dim sh As Worksheet
Application.ScreenUpdating = False
For Each sh In ThisWorkbook.Worksheets
sh.Protect userinterfaceonly:=True
Next sh
Application.ScreenUpdating = True
End Sub

Your code will work then


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Bob Phillips" wrote in message ...
Unprotect it first, do the copy, then protect it again.

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"bob" wrote in message
. ca...
i am trying to copy to a range of unprotected cells in a protected sheet.
the following will give an error after paste if destination sheet is
protected.
what copy statement would work
thanks

' copy from data to test
Range("A1:P350").Select
Selection.Copy
Sheets("test").Select
Range("W8").Select
ActiveSheet.Paste


' add autofilter back
Range("W12:AL12").Select
Application.CutCopyMode = False
Selection.AutoFilter

End Sub






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
Copy & paste to protected sheet nc Excel Discussion (Misc queries) 3 July 5th 09 10:38 PM
Copy paste Macro in a Protected Sheet [email protected] Excel Discussion (Misc queries) 1 January 9th 09 02:16 AM
Copy from Protected sheet Rao Ratan Singh New Users to Excel 2 March 8th 06 06:20 AM
How can I copy a protected sheet without copying the protection? mahros Excel Discussion (Misc queries) 4 September 27th 05 07:20 AM
How to copy/paste info into the protected sheet Dajana Excel Discussion (Misc queries) 1 September 21st 05 04:26 PM


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