Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default copy and paste from and to protected sheets

i have a file with many sheets, all protected. i want select cells in
one protected sheet, go to another protected sheet, select a cell, then
havea a macro unprotect the sheet, paste the cells, then protect the
sheet again.
thanks,

Tonso

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default copy and paste from and to protected sheets

A couple of possibilities. One would be to change the nature of the sheet
protection to UserInterfaceOnly at which point code can modify the sheet, but
not the user. That being said here is some code for protecting and
unprotecting all ot the sheets. Put this in it's own seperate module...

Option Explicit
Option Private Module

Private Const m_cModule As String = "modProtectUnprotect"
Private Const m_cPassword As String = "MyPassword"

Public Sub ProtectAll()
Dim wks As Worksheet

For Each wks In Worksheets
On Error Resume Next
wks.Protect Password:=m_cPassword ', UserInterfaceOnly:=True
Next wks
End Sub

Public Sub UnProtectAll()
Dim wks As Worksheet

For Each wks In Worksheets
On Error Resume Next
wks.UnProtect Password:=m_cPassword
Next wks
End Sub

--
HTH...

Jim Thomlinson


"Tonso" wrote:

i have a file with many sheets, all protected. i want select cells in
one protected sheet, go to another protected sheet, select a cell, then
havea a macro unprotect the sheet, paste the cells, then protect the
sheet again.
thanks,

Tonso


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
How can I copy/paste protected cells in excel JeneeLynn Excel Discussion (Misc queries) 0 April 18th 08 06:09 PM
allow me to copy and paste in a protected worksheet George New Users to Excel 3 August 13th 06 08:11 PM
Copy/Paste a protected cell Nat1 Excel Discussion (Misc queries) 3 August 8th 05 07:23 PM


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

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"