+ Reply to Thread
Results 1 to 3 of 3

excel-vba Run-time error '1004'

  1. #1
    Registered User
    Join Date
    09-08-2017
    Location
    India
    MS-Off Ver
    2013
    Posts
    4

    excel-vba Run-time error '1004'

    Below is my code

    Range("M2").Select
    Selection.FormulaArray = _
    "=IF(AND(RC8<=R1C,RC9>=EOMONTH(R1C,0)),INDEX(Planned!R2C:R100C,MATCH(1,(RC3=Planned!R2C3:R100C3)*(RC10=Planned!R2C10:R100C10)*(RC12=Planned!R2C12:R100C12),0)),ROUND((MAX(R1C[1]-MAX(RC8,R1C),0)-MAX(R1C[1]-MAX(RC9,R1C),0))*INDEX(Planned!R2C:R100C,MATCH(1,(RC3=Planned!R2C3:R100C3)*(RC10=Planned!R2C10:R100C10)*(RC12=Planned!R2C12:R100C12),0))/DAY(EOMONTH(R1C,0)),0))"

    When I try to run macro it's giving me below error (In Attached image)

    Error.JPG

    Any thoughts?

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: excel-vba Run-time error '1004'

    I didn't count them but most likely your formula exeeds the 255 character limit.

    Just counted them and it's 363 chars.
    Last edited by bakerman2; 09-19-2017 at 04:39 AM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    09-08-2017
    Location
    India
    MS-Off Ver
    2013
    Posts
    4

    Re: excel-vba Run-time error '1004'

    ohh..is their any way to apply this formula using macro..

+ 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. [SOLVED] I am getting error as "Run Time error '1004' Microsoft excel cannot paste the data
    By Amittapre in forum Excel Programming / VBA / Macros
    Replies: 43
    Last Post: 03-24-2017, 04:40 PM
  2. Excel VBA Run-time Error 1004 Name is already taken
    By luvidubsky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2015, 09:59 AM
  3. Replies: 0
    Last Post: 10-20-2014, 05:33 PM
  4. [SOLVED] Excel VB Run Time Error 1004
    By sharpyoungb in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-06-2014, 05:18 PM
  5. Excel Macro Error - Run time error 1004 - Paste method of worksheet class failed
    By kvflynn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2012, 10:51 AM
  6. Run-time error 1004 - Excel for Mac 2011
    By aussie89 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-22-2010, 06:14 PM
  7. run time error 1004 in excel 2007
    By jimb0693 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2008, 12:15 PM

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