+ Reply to Thread
Results 1 to 3 of 3

how to AUTO only if data is entered in them.

  1. #1
    Registered User
    Join Date
    08-15-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    57

    Exclamation how to AUTO only if data is entered in them.

    Hi,

    I have found the below module which let me lock cells automatically however it lock the cell even if i had press delete by mistake in that cell and cant entered value in it without 1st unprotecting the sheet.

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim MyRange As Range

    Set MyRange = Intersect(Range("A1:O1000"), Target)
    If Not MyRange Is Nothing Then
    Sheets("Sheet1").Unprotect Password:="1234"
    MyRange.Locked = True
    AllowFiltering = True
    Sheets("Sheet1").Protect Password:="1234"
    End If
    End Sub


    Note: All Cell have are protected however still data can be entered in them (but even if delete is pressed by mistake it gets locked, whereas it was supposed to be blocked only if some value is entered in them)

    thanks for the help

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166
    Hello cvishu,

    Welcome to Excelforum. Be a part of large Excel community. Enjoy Learning.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    08-15-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    57

    Re: how to AUTO only if data is entered in them.

    Hi,

    Arlu1201...can you inform me how to create a new post here??

    Reg,
    CVishu

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Auto-lock a row after data is entered
    By src16 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-25-2013, 09:50 AM
  2. Replies: 8
    Last Post: 01-23-2013, 03:36 AM
  3. Alpabetically Auto Sort when new data is entered
    By mstry510 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-04-2012, 08:39 AM
  4. Auto-format to overide entered data
    By LinkOps in forum Excel General
    Replies: 1
    Last Post: 06-09-2009, 04:04 AM
  5. Auto sorting as data is entered
    By drgogo in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-28-2009, 10:52 AM

Tags for this Thread

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