I want to select say three rows in a pivot table say "ABC sum" "SDF Sum", and "ZXC Sum" and highlight them yellow using vba? Any thoughts on how to do this?
I want to select say three rows in a pivot table say "ABC sum" "SDF Sum", and "ZXC Sum" and highlight them yellow using vba? Any thoughts on how to do this?
as you have excel 2010
i would use conditional format in pivot table for that instead of VBA
as the size and shape of pivot table can/will/might change
http://www.contextures.com/excelpivo...nalformat.html
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
in that case
use a loop for your sheet area
find rows that contain what you want
then range.interior.colorindex = 6
sorry for vagueness but pivot tables can be pretty shaped anyway so i dont know how your data structure looks like
as you are using macro to insert pivot table i assume you know how do what i suggested
if not let me know what you need help on
only curious part would be "selecting" do you mean by point and click or predefined terms
I know the general logic, but I am just learning the VBA syntax. This is my attempt that isn't working, that is only currently looking for one row to highlight. I have a count function as there can be empty cells in the A column and I want to make sure it the loop goes to the end of the pivot table.
Or is there a way to do it with something like ActiveSheet.PivotTables("PivotTerm (PivotTabe)").PivotFields("Field").interior.colorindex = 6?Please Login or Register to view this content.
Last edited by Boo123; 06-30-2015 at 12:33 PM.
not quite sure i follow what you are trying to achieve on your sheet
with a sheet i had used for previous pivot table VBA
i added CF_TO_Pivot
it will apply a CF to the pivot table
do note
if you refresh your pivot table the CF will no longer work...even if you did not actually put any new data in pivot table
also the CF will not work if you have existing CF on the sheet..which you shouldnt if like you said you create a new Pivot every time
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks