I've spent some time researching this but haven't been able to come close to finding an answer. So maybe someone here can help.
My office is using Excel 365 in Windows 10
I ran the below lines of code, then the "@" sign is showing up as part of the formulas on the excel spreadsheet, and causing erroneous formula results.
I would like to prevent Excel 365 from doing this, or come up with a solution in vba to eliminate this from '@' appearing in the spreadsheet formula.
Hope someone can help.
The vba code I have:
ws2.Range("K2:K" & iRow).Formula = "=SUM(IF($D$2:$D2=D2,($H$2:$H2),0))"
ws2.Range("M2:M" & iRow).Formula = "=IFERROR(SUM(IF($D$2:$D2=D2,($H$2:$H2)/E2,0)),""-"")"
The formula I expected to appear in the cells;
=SUM(IF($D$2:$D2=D2,($H$2:$H2),0))
=IFERROR(SUM(IF($D$2:$D2=D2,($H$2:$H2)/E2,0)),"-")
The formula that appears in the cells and produces miscalculations;
=SUM(IF($D$2:$D2=@D2,($H$2:$H2),0))
=IFERROR(SUM(IF(@$D$2:$D2=D2,(@$H$2:$H2)/E2,0)),"-")
The first time this happened today, I got a quick "popup" that said this is new, and the @ would not affect the formula result ... But it has
Does anyone have an idea how to eliminate this @ problem from appearing in the formula?
Thanks.
My office is using Excel 365 in Windows 10
I ran the below lines of code, then the "@" sign is showing up as part of the formulas on the excel spreadsheet, and causing erroneous formula results.
I would like to prevent Excel 365 from doing this, or come up with a solution in vba to eliminate this from '@' appearing in the spreadsheet formula.
Hope someone can help.
The vba code I have:
ws2.Range("K2:K" & iRow).Formula = "=SUM(IF($D$2:$D2=D2,($H$2:$H2),0))"
ws2.Range("M2:M" & iRow).Formula = "=IFERROR(SUM(IF($D$2:$D2=D2,($H$2:$H2)/E2,0)),""-"")"
The formula I expected to appear in the cells;
=SUM(IF($D$2:$D2=D2,($H$2:$H2),0))
=IFERROR(SUM(IF($D$2:$D2=D2,($H$2:$H2)/E2,0)),"-")
The formula that appears in the cells and produces miscalculations;
=SUM(IF($D$2:$D2=@D2,($H$2:$H2),0))
=IFERROR(SUM(IF(@$D$2:$D2=D2,(@$H$2:$H2)/E2,0)),"-")
The first time this happened today, I got a quick "popup" that said this is new, and the @ would not affect the formula result ... But it has
Does anyone have an idea how to eliminate this @ problem from appearing in the formula?
Thanks.