Results 1 to 11 of 11

Error 1004 in vba code

Threaded View

  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
    ActiveCell.Formula2R1C1 = _
    "=SUM(SUMIF('Line 1'!R3C1:R16C[-1],INDEX(Product[Prod],AGGREGATE(15,6,1/(Product[Group]=RC1)*ROW(Product[Group]),ROW(INDEX(C1,1):INDEX(C1,COUNT(1/(Product[Group]=RC1)*ROW(Product[Group])))))),'Line 1'!R3C2:R16C2))"


    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.

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