Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Microsoft Support > Microsoft Office support
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Microsoft Office support MS Office support forum

Reply
 
LinkBack Thread Tools
Old 02-25-2008, 05:03 PM   #1 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: XP


Excel 2007 Cell Locking After Data Entered?

So this is a 2 part question...

I am working on making an electronic time card for my company and I want the office girls to be able to type a preset word (=clock) to electrnoically time stap the card (which I have working fine) but I only want them to be able to input =clock and if anything else is entered for it to not accept it and once they type in =clock i also want it to where the cell will lock so they can't manually change the figure afterwards.


Part 1: Is it possible to limit the access of the data within a cell? I only want the person accessing the spreadsheet to be able to enter the value "=clock" into a given cell.

Part 2: Is it possible to lock a cell where it cannot be modified after someone initally puts something in the cell? So once they type "clock" the cell blocks any other access so they can't go back the next morning and type in =clock to make up for the day they may have been late on before.

Before it comes up, yes we have a old fashioned time clock but I am trying to get us out of the stone age.

Thank you in advance!
shawnb18 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Old 02-26-2008, 06:28 AM   #2 (permalink)
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
 
Glaswegian's Avatar
 
Join Date: Sep 2005
Location: Glasgow
Posts: 25,482
OS: Win XP Pro SP3 / Win 7 Pro

My System

Blog Entries: 10
Re: Excel 2007 Cell Locking After Data Entered?

Hi and welcome to TSF.

You can limit user input via Data Validation. On the menu bar Data > Vaildation - you can set whatever limits suit.

Yes you can do the second part using VBA code. I would use a Worksheet Event to test that you have the correct cell and the correct input and then lock the cell.
__________________
Iain - Defender of the Haggis and all things Scottish.
I don't help by PM - post in the Forums.



PC Safety & Security::PC running a bit slow?::Donate::Photographers Corner
Glaswegian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 02-26-2008, 07:46 AM   #3 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: XP


Re: Excel 2007 Cell Locking After Data Entered?

Thank you for your reply! How would I use VBA? I have never used it... If I can get the basics I can probably figure it out. Thank you!
shawnb18 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 02-26-2008, 03:25 PM   #4 (permalink)
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
 
Glaswegian's Avatar
 
Join Date: Sep 2005
Location: Glasgow
Posts: 25,482
OS: Win XP Pro SP3 / Win 7 Pro

My System

Blog Entries: 10
Re: Excel 2007 Cell Locking After Data Entered?

Hi

Here's a simple example. Note that locking a cell will only have an effect if the worksheet is protected. This example checks whether or not cell D5 has is empty or not. If empty the code exits and nothing happens. If there is a value in the cell, the cell property is changed to locked and the sheet is re-protected, thus ensuring that users cannot change D5.

Right click on the tab of sheet1 and select 'view code' - then copy and paste the code in the right hand pane. Then make sure D5 and a couple of other cells are unlocked, protect your sheet without a password and try it out. You can include a password if you want - it would just be a parameter after the Unprotect or Protect commands.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$D$5" Then Exit Sub

Sheets("Sheet1").Unprotect
If Target.Value <> "" Then
    Target.Locked = True
End If
Sheets("Sheet1").Protect
End Sub
Post back if you have any problems or questions.
__________________
Iain - Defender of the Haggis and all things Scottish.
I don't help by PM - post in the Forums.



PC Safety & Security::PC running a bit slow?::Donate::Photographers Corner
Glaswegian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 02-27-2008, 02:20 PM   #5 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: XP


Re: Excel 2007 Cell Locking After Data Entered?

Thank you! That works well. How can I do it for multiple cells?

F9 thru F15 and F21 thru F27 same cells with collums G,H and I.

Thank you again!
shawnb18 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 02-27-2008, 03:36 PM   #6 (permalink)
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
 
Glaswegian's Avatar
 
Join Date: Sep 2005
Location: Glasgow
Posts: 25,482
OS: Win XP Pro SP3 / Win 7 Pro

My System

Blog Entries: 10
Re: Excel 2007 Cell Locking After Data Entered?

Slight change to the code to allow for the various ranges
Code:
Private Sub Worksheet_Change(ByVal Target As Range)

If Intersect(Target, Range("F9:F15,F21:F27,G9:G15,G21:G27,H9:H15,H21:H27,I9:I15,I21:I27")) Is Nothing Then Exit Sub
    Sheets("Sheet1").Unprotect
        If Target.Value <> "" Then
            Target.Locked = True
        End If
Sheets("Sheet1").Protect
End Sub
Change your sheet names to suit.
__________________
Iain - Defender of the Haggis and all things Scottish.
I don't help by PM - post in the Forums.



PC Safety & Security::PC running a bit slow?::Donate::Photographers Corner
Glaswegian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 02-27-2008, 04:16 PM   #7 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: XP


Re: Excel 2007 Cell Locking After Data Entered?

That worked perfectly! Thank you for your help. I have another excel question but I will search for it first and then post a new thread if I can't find it so for easy search next time. Thank you again.
shawnb18 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 10-27-2008, 04:40 PM   #8 (permalink)
Registered User
 
mlrolling's Avatar
 
Join Date: Oct 2008
Posts: 3
OS: xp


Re: Excel 2007 Cell Locking After Data Entered?

I wanted to know how would I go about locking a cell after it has been changed.
mlrolling is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 12-30-2008, 11:28 PM   #9 (permalink)
Registered User
 
Join Date: Dec 2008
Posts: 1
OS: Xp


Re: Excel 2007 Cell Locking After Data Entered?

HI I have a similar question...I am new to VB and i need a code achieve the following table in Excel.
I have a table with columns A,B,C
If data is entered in cells of column A,Cells in columns B and C Should get locked.
If data in the cells of column A is deleted,then cells in columns B,C should be unclocked.

PLz ..PLz..NEEd an urgent help with this...my boss needs this immediatly..can any plzzzzzzzzzzz help me on this. asap...plzz..
archana5 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 04:49 PM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85