+ Reply to Thread
Results 1 to 3 of 3

VBA Using Combo to change Pivot Filter problems if data not in field

  1. #1
    Registered User
    Join Date
    05-09-2014
    MS-Off Ver
    Excel 2003
    Posts
    2

    VBA Using Combo to change Pivot Filter problems if data not in field

    I am using the below VBA to change several pivot filters based on a cell called "HOD". This cell is fed from a combo box of set values. The problem I have is that if one of the values from the combo box is selected but it does not appear in the HOD field in my pivot table, what happens is that whatever is selected overwrites the pivot field. I can't work out what I need to add into my code to say, if "HOD" is not in the HOD pivot field, then do nothing, otherwise filter according to what is in "HOD". Hope I have explained that OK

    Thanks

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: VBA Using Combo to change Pivot Filter problems if data not in field

    Hi.

    Do you tried to use Error Handler?

    See.
    http://www.globaliconnect.com/excel/...=79&Itemid=475
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  3. #3
    Registered User
    Join Date
    05-09-2014
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: VBA Using Combo to change Pivot Filter problems if data not in field

    Hi, thanks for replying. I am not sure how this would help? If already have in my code "On Error Resume Next" or am I missing something? The issue is that the item selected in the combo box is not in the pivot filter, but when I select that item in the combo it seems to over-ride whatever was in the the pivot filter previously

+ 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] VBA How to change data field in a pivot using VBA
    By Annieb307 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-12-2013, 08:32 AM
  2. [SOLVED] How to set a 'Date Filter' on a field in the 'Report Filter' section of a Pivot Table?
    By Rhino_dance in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 03-28-2013, 11:01 AM
  3. Replies: 0
    Last Post: 07-21-2010, 01:43 PM
  4. Replies: 0
    Last Post: 07-10-2010, 03:02 PM
  5. Pivot table filter data field to show items with count more than n
    By kuraitori in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-22-2010, 07:36 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