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