Application-defined or object-defined error for formula - vba

I'm trying to use the following code to input a formula but for some reason I get an application defined / object defined error for the 'iferror' formula I'm using.
ws_catalogue.Range("D3").Formula = "=IFERROR(INDEX('Test Input'!$E:$E,MATCH(CONCATENATE([#Actor],[#Entity],D$1),'Test Input'!$A:$A,0)),"""")"
ws_catalogue.Range("D3:N3").FillRight
ws_catalogue.Range("D3:N" & Total_cat).FillDown
Thanks in advance!

Related

VBA Runtime Error '1004' when attempting to Insert Formula

I've figured out how to insert a formula into a range of cells and managed to make it work once. Unfortunately, I can't get it to work with this formula. Instead I get an
Application-defined or object-defined error.
Here's what I'm attempting to run.
Sheets("P&L").Select
Range("A1:A250").Select
Selection.FormulaR1C1 = "=IF(ISNUMBER(LEFT(RC[+1],4)*1),LEFT(RC[+1]4,4)*1,)"
Selection.Columns.AutoFit
I suspect it has something to do with the * acting as a wildcard. I've put it in block quotes, but that just gives another error.
Any help is appreciated.
You've got an extra 4 in that formula.
Selection.FormulaR1C1 = "=IF(ISNUMBER(LEFT(RC[+1],4)*1),LEFT(RC[+1],4)*1, text(,))"

Run-time error 1004 WorksheetFunction.Sum

When using the below within powerpoint, I constantly get
Run-time error 1004 - Unable to get the Sum property of the WorksheetFunction class
Can anyone help?
TextBox10.Value = WorksheetFunction.Sum(Staff_Engagement_1.Value, Annual_Cost_To_Business_1.Value, Cost_To_Absence_1.Value, (-1) * TextBox11.Value)
You can't use worksheetfunction in PowerPoint. Since i'm assuming you're using a form by the TextBox10.Value, see How can I sum value in 8 textboxes to the a single textbox?

VBA : Error using Range.Formula

I'm using this formula
ThisWorkbook.Sheets("Overview").Range(formrange).Formula = "=IF(OR(ISBLANK(B2);WEEKDAY(DATE($B$38;$B$37;B2);2)>5;DAY(EOMONTH(DATE($B$38;$B$37;B$3);0))<B2);0;IF(C2=""Y"";0,5;1))"
And am having the following error
Run-time error "1004"
Application-denied or object-defined error
Would you guys have an idea what that is?
The Range.Formula property needs a formula string in the same format it would be entered into a cell on a computer with US regional settings. So for this example you need:
ThisWorkbook.Sheets("Overview").Range(formrange).Formula = "=IF(OR(ISBLANK(B2),WEEKDAY(DATE($B$38,$B$37,B2),2)>5,DAY(EOMONTH(DATE($B$38,$B$37,B$3),0))<B2),0,IF(C2=""Y"",0.5,1))"

Insert an advanced formula into a cell

Using Excel 2016 I am struggling to get a formula pasted into a cell with VBA (where the VBA does a data import). I have two sheets: Rapport SNN and Data.
Sheets("Rapport SNN").[E4].Formula = "=SUMIFS(Data!S2:Data!S2000;Data!V2:Data!V2000;""BankAxept"";Data!M2:Data!M2000;C4)/100"
Just throws me a:
Run-time error '1004': Application-defined or object-defined error.
What do I do wrong?
You have semicolons when they should be commas.
WorkSheets("Rapport SNN").[E4].Formula = "=SUMIFS(Data!S2:Data!S2000,Data!V2:Data!V2000,""BankAxept"",Data!M2:Data!M2000,C4)/100"

VBA Excel implement COUNTIF function

I am trying to implement a "COUNTIF()" function in my vba excel application. I know how to do this programatically but I want specifically to implement this as a formula so that later changes in the sheet will hold. This is the problematic line:
ActiveSheet.Cells(3, 20).FormulaR1C1 = "=COUNTIF(R11C7:R12C7;"">0"")"
It results in the following error:
Run-time error '1004': Application-defined or object-defined error
VBA defaults to US formatting unless otherwise specified - which you could do here using FormulaR1C1Local - so you need to use a comma separator, not a semicolon.