Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bonbon
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Paul B
 
Posts: n/a
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bonbon
 
Posts: n/a
Default Using macro to un/protect sheet


Thank you Paul B, that worked great!
you said, lock VBA project, how?

thanks again


--
Bonbon
------------------------------------------------------------------------
Bonbon's Profile: http://www.excelforum.com/member.php...o&userid=31866
View this thread: http://www.excelforum.com/showthread...hreadid=513415

Reply
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
macro to find cell content in sheets and make sheet active Nigel Excel Discussion (Misc queries) 4 June 26th 14 02:38 PM
Macro to Go to Sheet John Excel Discussion (Misc queries) 7 November 12th 06 05:22 AM
Macro that password protects a sheet Ryan Excel Discussion (Misc queries) 1 November 10th 05 05:42 PM
MACRO - copy rows based on value in column to another sheet Michael A Excel Discussion (Misc queries) 1 March 5th 05 02:15 AM
2 questions, copying data from sheet to sheet and assigning macro Boris Excel Worksheet Functions 0 December 16th 04 06:11 PM


All times are GMT +1. The time now is 03:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"