+ Reply to Thread
Results 1 to 6 of 6

remove filter options from chart

Hybrid View

  1. #1
    Registered User
    Join Date
    12-02-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    74

    remove filter options from chart

    Hi Guys,

    I would like to remove filter options available on Chart. How to do this using VBA? please refer to screen shot below:

    Capture.JPG

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,451

    Re: remove filter options from chart

    via the macro recorder

        ActiveChart.ShowAllFieldButtons = False
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    12-02-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    74

    Re: remove filter options from chart

    This gives me Run time Error: 1004

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,451

    Re: remove filter options from chart

    Make sure the chart is selected before running code

  5. #5
    Registered User
    Join Date
    12-02-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    74

    Re: remove filter options from chart

    I have added this line after adding chartobject and assigned sourcedata to chartobject. So I think this is selected. below is code I used:

    Worksheets("SheetName").ChartObjects("ChartName").Chart().Activate
     ActiveChart.ShowAllFieldButtons = False
    this does not work for me.
    Last edited by linok; 12-31-2014 at 07:21 AM.

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,451

    Re: remove filter options from chart

    Perhaps you can post example file.

    This recorder code shows adding the chart and turning the filters off.
        Cells(1, 1).Select
        ActiveSheet.Shapes.AddChart.Select
        ActiveChart.ChartType = xlColumnClustered
        ActiveChart.SetSourceData Source:=Range("Sheet4!$A$1:$C$18")
        ActiveChart.ShowAllFieldButtons = False
    I can however get the error 1004 if the chart is NOT a pivot chart.

+ 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. Replies: 5
    Last Post: 12-19-2013, 06:58 AM
  2. Large amount of data into chart with options to filter?
    By chifans in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 04-15-2013, 04:19 AM
  3. remove all save options from just one workbook
    By 2funny4words in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-23-2009, 01:14 PM
  4. Autofilters-Remove (Top 10...) and (Custom) options from the drop-
    By Jen in SoCA in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-26-2005, 11: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