+ Reply to Thread
Results 1 to 3 of 3

Using macro to un/protect sheet

  1. #1
    Bonbon
    Guest

    Using macro to un/protect sheet

    hi hi, thx agen for the previous helps =D
    i searched this up to see if i could find nething b4 disturbing you nice ppl
    lol, but i still dont understand.
    i want to make a button, which will allow the user to View the books n not
    rewrite. And a button which allows the user to actually add/edit the data,
    however this user would need to enter a password. i want both buttons to open
    the same workbook, but each with a different authority. I dont know how to
    create like a message or box where the user has to enter a password to gain
    access in adding new data .
    i've been thinkin long and hard but dont know where to start, can anyone
    help me out? lol

    thanks in advance =)

  2. #2
    Paul B
    Guest

    Re: Using macro to un/protect sheet

    Bonbon, how about something like this on the sheet so the user would have to
    enter a password to edit

    Sub PassWord_To_Edit()
    'must lock VBA project so you can't see the password in it
    Dim MyStr1 As String, MyStr2 As String
    With ActiveSheet
    MyStr2 = ("123") 'This is the password and it is CASE sensitive
    MyStr1 = InputBox("Password Is Required To Add/Edit Data")
    If MyStr1 = MyStr2 Then

    'put your code here to add data

    Else
    MsgBox ("Access Denied")
    End If
    End With
    End Sub


    --
    Paul B
    Always backup your data before trying something new
    Please post any response to the newsgroups so others can benefit from it
    Feedback on answers is always appreciated!
    Using Excel 2002 & 2003

    "Bonbon" <[email protected]> wrote in message
    news:[email protected]...
    > hi hi, thx agen for the previous helps =D
    > i searched this up to see if i could find nething b4 disturbing you nice

    ppl
    > lol, but i still dont understand.
    > i want to make a button, which will allow the user to View the books n not
    > rewrite. And a button which allows the user to actually add/edit the data,
    > however this user would need to enter a password. i want both buttons to

    open
    > the same workbook, but each with a different authority. I dont know how to
    > create like a message or box where the user has to enter a password to

    gain
    > access in adding new data .
    > i've been thinkin long and hard but dont know where to start, can anyone
    > help me out? lol
    >
    > thanks in advance =)




  3. #3
    Registered User
    Join Date
    02-23-2006
    Posts
    12
    Thank you Paul B, that worked great!
    you said, lock VBA project, how?

    thanks again

+ 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