+ Reply to Thread
Results 1 to 5 of 5

Does .Value copy the Locked cell value?

Hybrid View

  1. #1
    Registered User
    Join Date
    03-15-2010
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    75

    Does .Value copy the Locked cell value?

    I have the below code in one of my Macros:
    ThisWorkbook.Worksheets(WsNameTo).Range("ag35:ai53").Value = wb.Worksheets(WsNameFrom).Range("e7:g25").Value
    Every time I run my macro, the range of cells being copied into picks up the Locked attribute, which then interferes the next time I try to run the macro since the worksheet is protected and that range is now locked, causing an error. Is the .Value picking up the Locked Property or is something else in my code possibly causing the issue? If .Value is picking up the Locked property, is there another method to get the value of the cells without locking it?

    r/

    SUPPO

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Does .Value copy the Locked cell value?

    The error is coming from elsewhere. .Value only transfers the value, nothing else.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    03-15-2010
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Does .Value copy the Locked cell value?

    that's what I thought. just need to weed through the code I guess to see where it's getting locked again.

  4. #4
    Registered User
    Join Date
    03-15-2010
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Does .Value copy the Locked cell value?

    hmmm. I believe I found the culprit. the .Clear method did more than I thought it did. I should have used .ClearContents, which works when running the macro multiple times.

    r/

    SUPPO

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Does .Value copy the Locked cell value?

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. How to copy just the text in a locked cell?
    By danielneedssomehelp in forum Excel General
    Replies: 4
    Last Post: 09-19-2014, 12:06 AM
  2. [SOLVED] Unable to copy text from a locked cell... Help!
    By danielneedssomehelp in forum Excel General
    Replies: 10
    Last Post: 08-08-2014, 12:01 AM
  3. [SOLVED] Can't copy a locked cell when there is a command button with a macro attached to it...
    By danielneedssomehelp in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-07-2014, 12:48 PM
  4. Unable to copy text from a locked cell... Help!
    By danielneedssomehelp in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-06-2014, 11:43 PM
  5. How to copy a locked cell without formulae
    By peterandrewsuk in forum Excel General
    Replies: 2
    Last Post: 05-14-2013, 11:52 AM
  6. Replies: 2
    Last Post: 03-07-2012, 09:42 AM
  7. Copy Locked Cell Status
    By Sige in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-23-2005, 11:05 AM

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