Av8tordude
Well-known Member
- Joined
- Oct 13, 2007
- Messages
- 1,075
- Office Version
- 2019
- Platform
- Windows
I ran into an code error with my 2010 excel. Apparently Excel 2019 has support for some code that Excel 2010 does not support. Case in point…The below line of code causes an error in Excel 2010 but not in Excel 2019. How can I fix this?
.PivotFields("Exit Date").AutoGroup
.PivotFields("Exit Date").AutoGroup
VBA Code:
With Pvt
.PivotFields("Exit Date").Orientation = xlRowField
.PivotFields("Exit Date").AutoGroup
.AddDataField Pvt.PivotFields("Profit/Loss ($)"), "Sum of Profit/Loss ($)", xlSum
.PivotFields("Sum of Profit/Loss ($)").NumberFormat = "$#,##0.00;[Red]$-#,##0.00"
End With