+ Reply to Thread
Results 1 to 2 of 2

Protection

  1. #1
    ryanmhess
    Guest

    Protection

    I've made about 70 workbooks all saved as the specific product they hold
    information on. Each workbook has 4 sheets. Sheet 1 is where new data is
    entered. Sheet 2 lists the new data entered each time we enter it and just
    moves the older data down one row. Sheet 3 is our Certificate of Analysis
    which is very important and muct not be altered. Sheet 4 is a graph of the
    data entered for each parameter.

    The First macro I use inserts a new row on sheet 2 so that the new data can
    be added and all excisting data is shifted down.

    Private Sub CommandButton1_Click()
    Sheets("Sheet2").Select
    Selection.Insert Shift:=xlDown
    Sheets("Sheet1").Select
    End Sub

    The Second macro I use allows me to alter information on Sheet 1 and then
    transfers that information to the correct location on sheets 2,3, and 4.
    example:

    ''''''''''''''''''''Transfers Data From Sheet 1 To Sheet 2 And
    3''''''''''''''''''''

    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    Sheets("Sheet1").Select
    Range("B1").Select
    Selection.Copy
    Sheets("Sheet2").Select ' Product Name
    Range("E1").Select
    ActiveSheet.Paste
    Sheets("Sheet3").Select
    Range("B10").Select
    ActiveSheet.Paste


    Is it possible to Protect EVERY cell except a few select ones on sheet 1
    where data is entered so that once you enter and engage the macro you cannot
    go to sheet 2,3, or 4 and change anything?

    The problems I am having are when I protect every sheet except the select
    cells on sheet1 and I engage the first macro it will not shift the rows down
    on sheet2 because sheet 2 is protected. The other problem is since I am
    transfering data from sheet1 to the other 3 sheets it wont transfer the data
    to protected sheets.


    sorry for rambling.

    I just want to be the only person able to alter all the information of each
    workbook.
    I do however want other people to have the ability to open my workbook.
    Enter new data into the allocated cells ( cells B5 - B8 and B11 - B17) and
    engage the 2 macros transfering the data to sheets 2,3, and 4 while not
    giving them the ability to change any of the other information on sheet 1 or
    the other 3 sheets.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good evening Ryanmhess

    On Sheet 1 select all the cells that you want to be able to alter with the protection turned on. Once they are all selected press ctrl + 1. Go to protection, and uncheck the locked box. Now you can protect Sheet 1 and still be able to enter to a select range of cells. However, short of hiding the other sheets through your macro you cannot stop the other users from accessing them.

    You could also protect Sheet 2, and unprotect it from your macro, run the routine and reprotect it before returning the control to the user. The code would look something like this if protected with a password of "mypass":

    ActiveSheet.Unprotect Password:="mypass"

    ActiveSheet.Protect Password:="mypass"

    A note of caution : This protection is not particularly difficult to crack. It's OK to stop accidental erasure of info or to keep out casual users, but anyone beyond that can remove the password within 30 seconds.

    HTH

    DominicB

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1