Results 1 to 3 of 3

Thread: How to Lock or Unlock row basis previous cell input?

  1. #1
    Member
    Join Date
    Aug 2011
    Posts
    92
    Rep Power
    14

    How to Lock or Unlock row basis previous cell input?

    Hi,

    I have a daily task trackers wherein the employees inputs their daily task hours, but i wants that they should not be able to input the data in row 3 if B3 is blank. Also is it possible the code should through a message box saying "Description Is Blank".
    Workbook attached.


    Day Task.xlsx

    Thanks in advance.
    Rajesh

  2. #2
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    13
    Give this event code a try...

    Code:
    Private Sub Worksheet_Change(ByVal Target As Range)
      If Not Intersect(Target, Columns("C:K")) Is Nothing Then
        If Cells(Target.Row, "B") = "" And Target.Value <> "" Then
          MsgBox "The description is blank... you must have a description before you can fill in any tasks!"
          Application.EnableEvents = False
          Application.Undo
          Application.EnableEvents = True
        End If
      End If
    End Sub
    HOW TO INSTALL Event Code
    ------------------------------------
    If you are new to event code procedures, they are easy to install. To install it, right-click the name tab at the bottom of the worksheet that is to have the functionality to be provided by the event code and select "View Code" from the popup menu that appears. This will open up the code window for that worksheet. Copy/Paste the event code into that code window. That's it... the code will now operate automatically when its particular event procedure is raised by an action you take on the worksheet itself.

  3. #3
    Member
    Join Date
    Aug 2011
    Posts
    92
    Rep Power
    14
    Simply AWESOME.

    Thanks a lot Rick

Similar Threads

  1. How To Lock Or Protect Cell Using Data Validation
    By mahmoud-lee in forum Excel Help
    Replies: 4
    Last Post: 06-06-2013, 01:57 AM
  2. Adding specfic number to a available number in previous cell.
    By Rajesh Kr Joshi in forum Excel Help
    Replies: 2
    Last Post: 03-02-2013, 01:55 AM
  3. Replies: 3
    Last Post: 12-05-2012, 09:51 PM
  4. Scroll Lock and Unlock using VBA
    By LalitPandey87 in forum Excel Help
    Replies: 2
    Last Post: 11-08-2011, 08:59 AM
  5. Lock cells on the basis of date VBA
    By Rajesh Kr Joshi in forum Excel Help
    Replies: 22
    Last Post: 09-27-2011, 03:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •