Hi,
have a time tracker sheet in that there are 2 buttons are there for capturing start and end time. I need to give allow users to edit ranges for only for the column I (Remarks Column in the sheet) remaining all column should be non-editable. I have locked all the cells expect the column I and protect the sheet with password. But when I click on the start time its asking the password to generate the time. Unless I give the password time wont come.. I want this should come without asking password..how can I do this?
Attached the sheet for your reference...
With protected worksheets, if you want macros to act on protected cells you have to un-protect them first. This can be done quite easily by adding two lines to your code - one at the beginning and one atthe end (to re-protect your cells).
So users can't open the VB editor and see your password, you can protect the vba by clicking Tools -> VBA Project Properties -> Protection and check the 'Lock project' box and set a password. While superusers can break sheet and vba password protection in minutes, it will keep the average user from breaking in and changing anything.Sub anwitha() Sheets("timesheet").Unprotect Password:="your_password" . . Other code here . . Sheets("timesheet").Protect Password:="your_password" End Sub
Hope that helps!
I tried with this..but its not working..can u do it for the attached sheet which i have attached in this thread and then post?
Thanks in advance...
Note - do not proct the vb properties to view code.
pls help me.
Your code is working fine. If you actually have a password set (not a blank password) you have to add the bits after .Unprotect and .Protect as I showed above. Also note that cells F5:F8 do not contain the formula found in F9:F17. My guess is they probably should.
I'd also recommend not using ActiveSheet.Unprotect / .Protect. Specify the sheet name.
Sheets("Sheet1").Unprotect Password:="this is where your password goes"
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks