0

I am trying to remove my 'Div/0' error on my outputted Excel Sheet using my VBA Code.

My calculated field "AFC_pct" is causing the Div/0 error. I am unable to use the =IfError function because I keep getting a compile error

.CalculatedFields.Add "ACD_hrs", "=ACDTime/3600"
.CalculatedFields.Add "AuxOut_hrs", "=AuxOut/3600"
.CalculatedFields.Add "Avail_hrs", "=Avail/3600"
.CalculatedFields.Add "Other_hrs", "=Other/3600"
.CalculatedFields.Add "AFC_hrs", "=AFC_Time/3600"
.CalculatedFields.Add "AFC_pct", "=AFC_hrs/ 'Daily_SchdHrsWrk'"
=IfError("AFC_pct",0)
BigBen
  • 46,229
  • 7
  • 24
  • 40
Jenna Terral
  • 67
  • 2
  • 11

1 Answers1

0

Just hide the errors in the PT properties.

Pivot Table Options > Layout & Format > For Error Values Show

Check the box and leave the value blank, or enter the value you want to display.

enter image description here

Valon Miller
  • 1,156
  • 5
  • 9