LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
GB GB is offline
external usenet poster
 
Posts: 230
Default calculatedfields

Bracket the fields that you are adding with a single quote '
Such as " = 'Rest & Breaks' + 'Driving Time' "
(I have added and removed some spaces to make it easier to see, not sure how
well the "program" will handle the "additional" quotes or if it will
understand that Driving Time is different than Driving Time

But should fix your problem.


"Geoff" wrote:

Hi,
I have 2 table titles in a spreadsheet, 'Rest & Breaks" and 'Driving
Time'. When creating a PivotTable I get :
.PivotFields("Rest & Breaks") and
.PivotFields("Driving Time")

These are ok but how do i create a calculated field adding the 2 values
together? The following line does not work:

.CalculatedFields.Add "Duty Time", "=Rest & Breaks + Driving Time", True

I believe it is the '&' in Rest & Breaks which is the problem.

How can I get round this please without altering the titles.

T.I.A.

Geoff


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CalculatedFields in Pivots Geoff[_8_] Excel Programming 0 October 5th 03 11:03 AM


All times are GMT +1. The time now is 10:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"