+ Reply to Thread
Results 1 to 4 of 4

Protect/Unprotect VBA Script

  1. #1
    Registered User
    Join Date
    03-05-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Protect/Unprotect VBA Script

    Hi,

    I am new to Excel and wanting to know how i can update the below attached document to allow the form to enter informtaion but not allow editing in the LostProperetyTable sheet.

    I want the users to only be able to use the form to edit the table not by using the table itself.

    I have tried many varieties of coding to protect and unprotect the sheet but the code will not run.

    Could someone please assist?

    Thank you
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Dunc3142's Avatar
    Join Date
    09-05-2007
    Location
    Franklin OH
    MS-Off Ver
    2000 and 2007 and 2010 @ Home & Teach 2010
    Posts
    351

    Re: Protect/Unprotect VBA Script

    Please Login or Register  to view this content.
    Put these lines in your code just before your code puts the data in the data sheet and just after putting the data in the sheet.
    Yes it will. we just have to figure out how...
    If I have helped you, PLEASE click the * and add to my Rep.
    Also, if the problem is SOLVED please mark it as so.

  3. #3
    Registered User
    Join Date
    03-05-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Protect/Unprotect VBA Script

    Hi Dunc3142,

    Thanks for your help, i have added the code above and below the code but it gets stuck at the first row of inserting the data:

    ws.Cells(iRow, 1).Value = Me.txtDate.Value

    Please see attached file in case i have added it in the wrong space.

    Thanks again for your help!!
    Attached Files Attached Files

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Protect/Unprotect VBA Script

    Hi, Heat,

    Sheet2 is the code name for 'Lost Property Form' while you want to write data to 'LostPropertyTable' which is Sheet1.

    HTH,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

+ 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