+ Reply to Thread
Results 1 to 5 of 5

Run time error 1004 assigning a value to a cell

  1. #1
    Registered User
    Join Date
    10-27-2020
    Location
    Australia
    MS-Off Ver
    MS 2019
    Posts
    37

    Run time error 1004 assigning a value to a cell

    Hi,

    Could you please explain why this line returns an error?

    Screenshot 2021-06-08 150221.jpg

    The line above is exactly the same and is working fine. Additionally, the same code works with no troubles in another workbook.

    Thanks for your help.
    Last edited by kapi98; 06-08-2021 at 07:10 PM.

  2. #2
    Forum Moderator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    365
    Posts
    21,151

    Re: Run time error 1004

    What is the ActiveSheet when this code executes?

    What module contains this code?

    At the point where the error occurs, I would go to the immediate window and type

    ?Range("A178").Parent.Name
    ?ActiveSheet.Name

    and see if they are the same sheet. My guess is that they are different and the see you are changing is still protected.

    We could run this down a lot faster if you attach your file so we can run the code. See yellow banner at the top of the page.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Moderator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    365
    Posts
    21,151

    Re: Run time error 1004 assigning a value to a cell

    Oh, by the way, why are you assigning "239" instead of 239? That has nothing to do with your error, just seems unusual.

  4. #4
    Registered User
    Join Date
    10-27-2020
    Location
    Australia
    MS-Off Ver
    MS 2019
    Posts
    37

    Re: Run time error 1004 assigning a value to a cell

    Thanks for your help. I've slightly rewritten the code ad it's now working well.

  5. #5
    Forum Moderator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    365
    Posts
    21,151

    Re: Run time error 1004 assigning a value to a cell

    Could you please share the rewrite? It may help someone else with a similar problem who finds this thread in a search. 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. Error 1004 while assigning password for AuditLog sheet
    By CKV747 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2021, 02:23 AM
  2. [SOLVED] Run-time error 1004 when coding in-cell dropdown
    By excell_rookie in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-01-2018, 04:36 AM
  3. Prevent editing more than one cell at a time - get error 1004
    By tv69 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-24-2014, 10:00 AM
  4. Run-Time Error 1004 when changing cell fill to None via macro
    By Gara in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-21-2012, 02:53 PM
  5. [SOLVED] run time error 1004, cell or chart is protected.
    By ndtsteve in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-09-2012, 12:42 PM
  6. changing cell triggers Run-time error 1004
    By Langston in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-09-2009, 11:36 AM
  7. [SOLVED] Run-time error 1004: Too many different cell formats
    By Randy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-16-2006, 10:15 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