Results 1 to 14 of 14

VBA Code not unlocking specified cell...What am I doing wrong??????

Threaded View

  1. #1
    Registered User
    Join Date
    11-13-2013
    Location
    Tempe, Arizona
    MS-Off Ver
    Excel 2010
    Posts
    6

    VBA Code not unlocking specified cell...What am I doing wrong??????

    Like most newbies I have a question that the rest can probably answer in their sleep but for the life of me I cannot get what I need to work!!!!

    I am trying to lock/protect Column "G" and make it accesible only if the contents in Column "F" (Rows 2 thru infinity) is either the letter "F" or "P" and to do nothing and continue to keep Column "G" locked/protected if the contents in Column "F" are "C" or nothing. I will eventually protect it with a password when I decide to allow other users to use the worksheet but for now it will be just me using it for the time being. This is what I have and please forgive me if I violate any rules as I am just trying to get past this difficult hurdle:

    Private Sub Worksheet_Change(ByVal Target As Range)
        ActiveSheet.Unprotect
        If Intersect(Target, Range("F2:F200")) Is Nothing Then Exit Sub
        If Target = "F" Or "P" Then
            Target.Offset(0, 7).Locked = False
        End If
        ActiveSheet.Protect
    End Sub
    Please help if you have the time because I am running out of it! A thousand apologies again for any violations or for coming off as a rookie, just need to get this taken care of so I can move forward in my life...lol
    Last edited by arlu1201; 11-13-2013 at 01:07 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Wrong coding or RANDBETWEEN is wrong?
    By zbor in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 07-31-2013, 10:01 AM
  2. Don't know what's wrong
    By eastray76 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-19-2008, 03:21 PM
  3. [SOLVED] What's that wrong?
    By Cactus in forum Excel General
    Replies: 1
    Last Post: 03-30-2006, 04:35 AM
  4. [SOLVED] What's wrong with this?
    By Damien McBain in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-07-2005, 10:05 AM
  5. [SOLVED] What am I doing wrong?
    By Jeff in forum Excel General
    Replies: 6
    Last Post: 03-05-2005, 11:07 PM

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