Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PivotTable question

Status
Not open for further replies.

bojzon

IS-IT--Management
Sep 18, 2003
25
SI
If I run VBA routine (Win XP. excel 2003):

ActiveSheet.PivotTables("PivotTable1").PivotSelect ("'Row Grand Total'"), xlDataAndLabel, True
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Selection.Font.Italic = True

I get 1004 ERROR (about false formula)
I did some variation with "' '" without success.

If I run the same routine with F8 step by step, code go through without ERRORS.

How come, any idea?

 
You will need to use " " only around the name and I would've thought that you will need to reference the field that you are looking for the grand total for:

ActiveSheet.PivotTables("PivotTable1").PivotSelect ("FieldName Grand Total"), xlDataAndLabel, True


Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top