I am using the following as part of an automated pivot table.
ActiveSheet.PivotTables("PivotTable2").AddDataField ActiveSheet.PivotTables( _
"PivotTable2").PivotFields("19-May-03"), "Count of 19-May-03", xlCount
ActiveWorkbook.ShowPivotTableFieldList = False
The 19-May-03 value can change and therefore, I would like to set this value from the value in a specific cell (u7).
The problem being is that when I assign the value in u7 to a variable within the macro, it assumes a format of dd/mm/yy, rather than dd-mmm-yy that the data is in.
Is there a way to convert the date format, within the code ?
TIA

ActiveSheet.PivotTables("PivotTable2").AddDataField ActiveSheet.PivotTables( _
"PivotTable2").PivotFields("19-May-03"), "Count of 19-May-03", xlCount
ActiveWorkbook.ShowPivotTableFieldList = False
The 19-May-03 value can change and therefore, I would like to set this value from the value in a specific cell (u7).
The problem being is that when I assign the value in u7 to a variable within the macro, it assumes a format of dd/mm/yy, rather than dd-mmm-yy that the data is in.
Is there a way to convert the date format, within the code ?
TIA