Results 1 to 6 of 6

Trying to insert formula into cell using ActiveCell.Formula but receiving run-time error

Threaded View

rbaxter89 Trying to insert formula into... 11-28-2022, 03:52 PM
TMS Re: Trying to insert formula... 11-28-2022, 04:02 PM
JieJenn Re: Trying to insert formula... 11-28-2022, 04:03 PM
TMS Re: Trying to insert formula... 11-28-2022, 04:03 PM
TMS Re: Trying to insert formula... 11-28-2022, 04:28 PM
rbaxter89 Re: Trying to insert formula... 11-28-2022, 04:33 PM
  1. #1
    Registered User
    Join Date
    11-16-2022
    Location
    Los Angeles
    MS-Off Ver
    2022
    Posts
    13

    Trying to insert formula into cell using ActiveCell.Formula but receiving run-time error

    Hello experts,

    I am trying to create a macro that inserts a formula into a cell, but I keep receiving a run-time error '1004' application-defined or object-defined error. I have tried several variations of the ActiveCell.Formula including .FormulaLocal.

    Here is the portion of the code where the error is popping up:


    Sub InsertFormulaIntoCell()

    Range("P10").Select
    ActiveCell.Formula = "=IFERROR((NETWORKDAYS.INTL(M8,O8,1,$Z$2:$Z$13)-(WORKDAY.INTL(M8-1,1,1,$Z$2:$Z$13)<M8)-(WORKDAY.INTL(O8-1,1,1,$Z$2:$Z$13)<O8))*($F$4-$F$3)+MAX(,MOD(O8,1)-$F$3)*(WORKDAY.INTL(O8-1,1,1,$Z$2:$Z$13)<O8)+MAX(,$F$4-MOD(M8,1))*(WORKDAY.INTL(M8-1,1,1,$Z$2:$Z$13)<M8),"")"

    End Sub


    Any advice or recommendations to enable the macro to correctly input this formula without error are greatly appreciated.


    Best Regards,

    Ray
    Attached Files Attached Files
    Last edited by rbaxter89; 11-28-2022 at 03:54 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Receiving VALUE error in a cell that has this formula
    By cubangt in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-28-2021, 03:01 PM
  2. nested if min formula receiving #VALUE! error
    By whitecastle in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-11-2017, 02:18 PM
  3. Receiving a #REF! error on an INDEX MATCH Formula
    By thomashasler in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-13-2015, 10:51 AM
  4. [SOLVED] Formula Tracking Time In Military Format - Receiving Error
    By DDM64 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-22-2013, 05:24 AM
  5. [SOLVED] Receiving #DIV/0! Error in Basic Formula
    By DDM64 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-10-2013, 11:29 AM
  6. Receiving #NAME? error when adding MONTHS to a formula
    By smsolomon in forum Excel General
    Replies: 2
    Last Post: 02-09-2012, 12:03 PM
  7. ActiveCell.Formula Error
    By Dennis Lavallee in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2008, 03:43 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