Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy & paste to protected sheet | Excel Discussion (Misc queries) | |||
Copy paste Macro in a Protected Sheet | Excel Discussion (Misc queries) | |||
Copy from Protected sheet | New Users to Excel | |||
How can I copy a protected sheet without copying the protection? | Excel Discussion (Misc queries) | |||
How to copy/paste info into the protected sheet | Excel Discussion (Misc queries) |