Results 1 to 4 of 4

Run-time error '1004' Unable to set the Locked Property of the Range Class

Threaded View

medakiva Run-time error '1004' Unable... 10-09-2013, 04:19 AM
OllieB Re: Run-time error '1004'... 10-09-2013, 05:18 AM
medakiva Re: Run-time error '1004'... 10-09-2013, 09:07 AM
OllieB Re: Run-time error '1004'... 10-09-2013, 09:13 AM
  1. #1
    Registered User
    Join Date
    10-09-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2003 and 2010
    Posts
    2

    Exclamation Run-time error '1004' Unable to set the Locked Property of the Range Class

    I would greatly appreciate some help with the following code please... I know what is causing the problem from reading up on it but I have no idea as to how to rewrite the code...

    Here is the code...

    Private Sub Row1_Click()
    
    With Range("B14:D14,F14:H14")
            If .Cells(1).Locked Then
                If InputBox("Enter password to enable editing?") = "mypassword" Then
                    MsgBox "Unlocked for editing"
                    .Locked = False
                Else
                    MsgBox "Incorrect password!"
                End If
            Else
                .Locked = True
                MsgBox "Row now locked!"
            End If
        End With
    
    End Sub
    and the error occurs on the line .Locked = False

    I have tried relocating the line but that only produces other errors...

    Would really appreciate some help and the chance to increase my knowledge...

    Many thanks in advance...

    Moderator Note:

    Pls use code tags around your code next time as per forum rules.
    Last edited by Fotis1991; 10-09-2013 at 04:36 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Run time error 1004: Unable to set hidden property of range class
    By SAVIOBLUEFOX in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-06-2013, 10:38 AM
  2. Run-time error '1004' Unable to set the Locked Property of the Range Class
    By Jerums in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 03-04-2013, 04:22 PM
  3. Run-time error 1004; "Unable to set the Hidden property of the Range Class"
    By danimal_time in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-22-2012, 01:06 PM
  4. Help Please w/ Run-time error '1004' Unable to set the Hidden property of the Range Class
    By ExcelNewbie2534 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2012, 07:38 PM
  5. Run-time error 1004: Unable to set the hidden property of the Range class.
    By seabee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-14-2011, 05:09 PM

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