programerAnel
New Member
- Joined
- Aug 28, 2018
- Messages
- 5
To create pivot table i use
After that i need to format the column "Neto" to
The point is if i use like this
it will format the column "Number of workers" as well which i don't want to
How to format only column "Neto" or as many exist, because it can be from 1 to n
Code:
xlBook.ActiveSheet.PivotTableWizard(Excel.XlPivotTableSourceType.xlDatabase, xlSheet.Range("A1:D" & ukupno))
xlBook.ActiveSheet.PivotTables(1).PivotFields("Poslovna jedinica").Orientation = Excel.XlPivotFieldOrientation.xlRowField
xlBook.ActiveSheet.PivotTables(1).PivotFields("Opština").Orientation = Excel.XlPivotFieldOrientation.xlColumnField
xlBook.ActiveSheet.PivotTables(1).PivotFields("Neto").Orientation = Excel.XlPivotFieldOrientation.xlDataField
xlBook.ActiveSheet.PivotTables(1).PivotFields("Number of workers").Orientation = Excel.XlPivotFieldOrientation.xlDataField
After that i need to format the column "Neto" to
Code:
.NumberFormat = "#,##0.00_);[Red](#,##0.00)"
The point is if i use like this
Code:
xlBook.Worksheets("Pivot").Range("C:F").NumberFormat = "#,##0.00_);[Red](#,##0.00)"
it will format the column "Number of workers" as well which i don't want to
How to format only column "Neto" or as many exist, because it can be from 1 to n