+ Reply to Thread
Results 1 to 8 of 8

Select Rows in Pivot Table and Hightlight

  1. #1
    Registered User
    Join Date
    10-31-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    41

    Select Rows in Pivot Table and Hightlight

    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?

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Select Rows in Pivot Table and Hightlight

    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.

  3. #3
    Registered User
    Join Date
    10-31-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Select Rows in Pivot Table and Hightlight

    Quote Originally Posted by humdingaling View Post
    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
    Unfortunately, I have to use the macro on a new pivot table on a daily basis, so conditional formatting would still make it a repetitive task.

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Select Rows in Pivot Table and Hightlight

    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

  5. #5
    Registered User
    Join Date
    10-31-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Select Rows in Pivot Table and Hightlight

    Quote Originally Posted by humdingaling View Post
    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
    Yah part of the issue is my vagueness in how I worded it. Sorry about that. Thanks for the help. All the cells that would trigger the highlighting are in the first column.

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Select Rows in Pivot Table and Hightlight

    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

  7. #7
    Registered User
    Join Date
    10-31-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Select Rows in Pivot Table and Hightlight

    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.

    Please Login or Register  to view this content.
    Or is there a way to do it with something like ActiveSheet.PivotTables("PivotTerm (PivotTabe)").PivotFields("Field").interior.colorindex = 6?
    Last edited by Boo123; 06-30-2015 at 12:33 PM.

  8. #8
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Select Rows in Pivot Table and Hightlight

    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
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] HightLight Rows conditions
    By yukioh in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-02-2015, 06:32 AM
  2. compare 2 rows and hightlight chnages
    By steve111 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-03-2014, 04:20 AM
  3. Pivot Table select all Pivot Items not working as intended
    By rasonline in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-13-2014, 05:22 PM
  4. [SOLVED] Select all subtotal rows on Pivot Table
    By Marcotte A in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-12-2012, 01:31 AM
  5. Automatically Hightlight Rows with w/Date Check?
    By Al Franz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-18-2005, 10:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1