excel12345u
New Member
- Joined
- Apr 17, 2023
- Messages
- 2
- Office Version
- 2021
- Platform
- Windows
Hi there,
I have VBA that needs to copy formulas when a new row was added
in VBA code that pasting the formula is like this
Pasted formula is not working because in the cell when I click I can see that there are additional @ signs, like this
Why is this happening? How do I stop this from happening?
Thanks in advance!
I have VBA that needs to copy formulas when a new row was added
in VBA code that pasting the formula is like this
VBA Code:
For i = lastRow + 1 To lastRow + count2 - count1
criteriaSheet1.Range("C" & i).Formula = "=IFERROR(INDEX('Sheet2'!$F$3:$F$" & lastRow & ",MATCH(0,IF('Sheet 2'!$C$3:$C$" & lastRow & "<>3,1,IF('Sheet 2'!$A$3:$A$" & lastRow & "<>B" & i & ",1,COUNTIF($C$12:C" & i - 1 & ",'Sheet 2'!$F$3:$F$" & lastRow & ")))),0),"""")"
Next i
Pasted formula is not working because in the cell when I click I can see that there are additional @ signs, like this
Excel Formula:
=IFERROR(@INDEX('Sheet 2'!$F$3:$F$84,MATCH(0,IF(@'Sheet 2'!$C$3:$C$84<>3,1,IF(@'Sheet 2'!$A$3:$A$84<>B86,1,COUNTIF($C$12:C85,@'Sheet 2'!$F$3:$F$84)))),0),"")
Why is this happening? How do I stop this from happening?
Thanks in advance!