LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,073
Default Pasting to Protected Cells in Xl2000

-VMill wrote:
Thanks for the suggestion, however, I really need a solution that does not
rely on a user enabling macros.
-VMill

Hi -VMill,

If you add an extra worksheet and name it "Must Enable Macros" you can
use the following codes to hide the worksheets except for "Must Enable
Macros" which can also instruct the user to close the workbook then
reopen and click on "Enable macros". If the user follows the
instruction the reopened workbook will have visible sheets and will be
able to work on them and will not be able to select your protected
cells because the code also reinstates the xlUnlockedCells selection
property.

Use the same password for protecting each sheet and insert that
password into the speech marks in the code where you see Password:=
""....

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ScreenUpdating = False
Worksheets("Must Enable Macros").Visible = xlSheetVisible
Dim Sht As Worksheet
For Each Sht In Me.Worksheets
On Error GoTo PROTECTED
If Sht.Name < "Must Enable Macros" Then
Sht.Visible = xlSheetVeryHidden
End If
Next Sht
Exit Sub
PROTECTED:
Sht.Unprotect password:=""
Sht.Visible = xlSheetVeryHidden
Sht.Protect password:=""
Resume Next
End Sub

Private Sub Workbook_Open()
Application.ScreenUpdating = False
Dim Sht As Worksheet
For Each Sht In Me.Worksheets
Select Case Sht.Name
Case "Must Enable Macros"
On Error GoTo PROTECTED
Sht.Visible = xlSheetVeryHidden
Case Else
Sht.Visible = xlSheetVisible
Sht.EnableSelection = xlUnlockedCells
End Select
Next Sht
Exit Sub
PROTECTED:
Worksheets(Worksheets.Count - 1).Unprotect password:=""
Sht.Visible = xlSheetVeryHidden
Worksheets(Worksheets.Count - 1).Protect password:=""
Resume Next
End Sub

Both lots of go go into the ThisWorkbook code module as before

Ken Johnson

 
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
Protected worksheet with unprotected cells i.c.w. remarks FrankOtter68 Excel Worksheet Functions 1 April 17th 06 04:21 AM
Protected cells Roy Excel Discussion (Misc queries) 11 August 25th 05 02:33 PM
Protected Cells Jo Excel Discussion (Misc queries) 2 June 14th 05 06:25 PM
Viewing protected cells AC_VID Excel Discussion (Misc queries) 1 April 10th 05 01:21 AM
Auto Skipping and protected cells Dave Peterson Excel Discussion (Misc queries) 6 January 27th 05 11:35 PM


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