+ Reply to Thread
Results 1 to 5 of 5

Read Only VBA Sheet

Hybrid View

  1. #1
    Registered User
    Join Date
    08-03-2010
    Location
    West Midlands
    MS-Off Ver
    Excel 2003
    Posts
    7

    Read Only VBA Sheet

    Hello,

    Can anyone help I have created a excel spreadsheet where by different users can add information into a spreadsheet through a user form.

    The information is then displayed a sheet within the workbook.

    By only problem is that some users are going in and messing with the data, is there anyway I can make it read only with out it affecting inputting data.

    i tried making the sheet read only put the userform comes up with an error.

    Thanks

    Mel

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Read Only VBA Sheet

    The user form will need to uprotect the sheet when it wants to write data and re-protect it when it has done so.

  3. #3
    Registered User
    Join Date
    08-03-2010
    Location
    West Midlands
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Read Only VBA Sheet

    Can you point me in the right direction, can find the coding for it.
    Thanks

    Mel

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Read Only VBA Sheet

    Unprotect the sheet using...

    sheet.Unprotect("secret")
    You'll have to set the sheet object to match the sheet you're writing data to and set the password to whatever your real password is.

    Protect it again using

    sheet.Protect("secret")

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Read Only VBA Sheet

    Try the ProtectWithUserInterface method. For details & example see here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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