+ Reply to Thread
Results 1 to 4 of 4

Entering in data in specific cells using range protect or locking the cells

Hybrid View

howard101 Entering in data in specific... 04-05-2008, 06:29 AM
royUK Protecting Cells will not... 04-05-2008, 07:17 AM
royUK I think this is what you want... 04-05-2008, 08:18 AM
royUK Example for above 04-05-2008, 11:05 AM
  1. #1
    Registered User
    Join Date
    11-11-2007
    Posts
    25

    Entering in data in specific cells using range protect or locking the cells

    I would like VBA Code that will that will protect the following cells i.e force me to enter cells in the following ranges

    A2, A5, A7, C2, D2. When I enter twice after enter data in D2, then macro must end

    Your assistance will be most appreciated

    Howard
    http://www.mrexcel.com/forum/showthr...ghlight=howard
    Attached Files Attached Files

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Protecting Cells will not force Input
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I think this is what you want

    Option Explicit
    Private Sub Worksheet_Deactivate()
        Dim ThisSheet As Worksheet
        Dim r      As Range
        Const msg  As String = "You must enter data in: "
        Set ThisSheet = Worksheets("M_ECMHO")
        For Each r In Range("N2,N4,N6,P4:P5")
            If IsEmpty(r) Then
                MsgBox msg & vbLf & r.Address, vbCritical, "Incomplete entries..."
                Application.Goto ThisSheet.Range(r.Address)
                Exit Sub
            End If
        Next
    
    End Sub

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Example for above
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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