+ Reply to Thread
Results 1 to 11 of 11

Error 1004 in vba code

  1. #1
    Registered User
    Join Date
    07-21-2020
    Location
    Washington, DC
    MS-Off Ver
    365
    Posts
    20

    Error 1004 in vba code

    I keep getting an error at that line when running my vba code. The error says "run time error '1004': application defined or object defined error." The code on that row is
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This is code is repeated over 30 times in my code. I'm sure there's a more efficient way of doing this but I found that whenever I run my macro, it deleted the formulas from my other cells so I thought it would be best to just include the formula in my code. Any help on this topic would be much appreciated. Thanks in advance!
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by planjb; 07-27-2020 at 02:22 PM.

  2. #2
    Forum Expert
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    1,557

    Re: Error 1004 in vba code

    See big yellow banner - how to upload a workbook.
    Without it we will all be guessing randomly.

  3. #3
    Registered User
    Join Date
    07-21-2020
    Location
    Washington, DC
    MS-Off Ver
    365
    Posts
    20

    Re: Error 1004 in vba code

    Sorry about that! I'll upload it now!

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham
    MS-Off Ver
    365
    Posts
    8,489

    Re: Error 1004 in vba code

    What version of excel are you using?

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,238

    Re: Error 1004 in vba code

    planjb

    The code in the attached workbook works without error for me.
    If posting code please use code tags, see here.

  6. #6
    Registered User
    Join Date
    07-21-2020
    Location
    Washington, DC
    MS-Off Ver
    365
    Posts
    20

    Re: Error 1004 in vba code

    I'm using 365 ProPlus version 1908

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham
    MS-Off Ver
    365
    Posts
    8,489

    Re: Error 1004 in vba code

    In that case can you please update your profile which says 2010.

    Also try removing the 2 from this line
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    07-21-2020
    Location
    Washington, DC
    MS-Off Ver
    365
    Posts
    20

    Re: Error 1004 in vba code

    Yes, it works without error for my personal laptop using excel version 16.39 but it keeps giving me an error debug when attempting to run it on my work laptop using excel version 1908.

  9. #9
    Registered User
    Join Date
    07-21-2020
    Location
    Washington, DC
    MS-Off Ver
    365
    Posts
    20

    Re: Error 1004 in vba code

    Sorry about the incorrect MS version! I'm working between my personal and work laptops so I had both up in case. Also, the 2 solved it for me! Thanks so much for the help!! I had been struggling with this all weekend

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham
    MS-Off Ver
    365
    Posts
    8,489

    Re: Error 1004 in vba code

    You're welcome & thanks for the feedback.

    PS your Excel version is 365

  11. #11
    Registered User
    Join Date
    07-21-2020
    Location
    Washington, DC
    MS-Off Ver
    365
    Posts
    20

    Re: Error 1004 in vba code

    I'm very new to excel as you can see!! I appreciate you telling me... I obviously have a lot to learn

+ 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 - object-defined error when vba code not applicable
    By SubwAy in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 06-20-2016, 05:20 AM
  2. Replies: 4
    Last Post: 11-15-2013, 05:03 PM
  3. VBA Code...error = run time error 1004 autofilter method of range class failed
    By Dariusd7 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-15-2013, 04:49 PM
  4. I get a 400 error or 1004 error depending on where I run the code
    By mouseman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-30-2013, 10:38 AM
  5. [SOLVED] Getting Error 1004 Object or Application Defined Error - Code to rearrange data
    By BlazzedTroll in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 06-10-2013, 12:10 PM
  6. [SOLVED] Range error in code, runs alone but not inside my full program, giving runtime error 1004
    By charizzardd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2012, 03:34 PM
  7. Error code #1004
    By kendenning in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-01-2010, 11:34 AM

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