Loop through columns of excel pivot with vba -


i trying loop through columns of pivottable add conditional formatting. cant figure out how select data of column. able select columnheader. in following code left conditional formatting part away reduce complexity.

sub format_pivot_columns()   set pt = activesheet.pivottables("piv_scrapedata")   each ptfld in pt.columnfields     ptfld.datarange.select     selection.interior.color = vbyellow   next ptfld end sub 

any idea? thanks!

i ended following code works charm. inspiration!

sub format_pivot_columns()  set pt = activesheet.pivottables("piv_scrapedata")  each ptfld in pt.databodyrange.columns   ptfld.select   selection.interior.color = vbyellow  next ptfld end sub 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -