• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Help

Hi,

I am new to Excel VBA programming. Recorded the macro for pivot table but it is not working properly.

My data sheet consits of Current week (CW) 44,45,46 etc and Task code A,B,C,D etc. Want to know for Current week-44 how may task A,B,C completed then CW-45 how many task B,C,D completed then so on.... In pivot Table Report Filter filed column draging "Current week", Row Lable "Task code" and Values Field "Count of Task Code". The Task code of Row leble is not getting exuceted while runnig the macro but values filed working perfectly. Any body please help me to solve the problem.

Thank you in advance for your help and support.

CODE


Sub Pivottable()
'
' Pivottable Macro
'

'
ActiveWorkbook.Worksheets("Sheet2").PivotTables("PivotTable5").PivotCache. _
CreatePivotTable TableDestination:="Sheet4!R5C2", TableName:="PivotTable8" _
, DefaultVersion:=xlPivotTableVersion14
Sheets("Sheet4").Select
Cells(5, 2).Select
With ActiveSheet.PivotTables("PivotTable8").PivotFields("CW")
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable8").PivotFields("Task Code")
.Orientation = xlRowField
.Position = 1
End With
ActiveSheet.PivotTables("PivotTable8").AddDataField ActiveSheet.PivotTables( _
"PivotTable8").PivotFields("Task Code"), "Count of Task Code", xlCount
End Sub

Regards,
sangram
 
Hi,

must be very precise with your discussion's title ‼

VBA Help : it's the VBA Macros section, well done ! And this forum is devoluted to help !

But what's its subject ?

Regards !
________________________________________________
If you can’t explain it simply, you don’t understand it well enough … (Albert Einstein)
 
Hi Marc L,

I need the VBA macro solutions because facing the above issue. Your Title name should always unique so you may get attention an it worked also. I do not think the title should change.

Thank you.
 
Hi Sangram,

I have trouble understanding your concept for the VBA macro. It would help if you can upload a sample excel file with the pivot table and data.

Regards.
 
Dear Ravikiran,

Thank you so much for your reply.

Please find the attached xlsm file.While running the macro in Pivot Table ROW LABEL-"TASK CODE" is not giving the out put.

I have mentioned all the detail in the attach file.Please help me to resolve the problem.

Regards
sangram
 

Attachments

  • Excel pivot table.xlsm
    27.1 KB · Views: 2
Back
Top