+ Reply to Thread
Results 1 to 9 of 9

Using VBA code to auto filter ?

  1. #1
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Using VBA code to auto filter ?

    Hello everyone. I am currently trying to use VBA code to auto filter for some data. The code can be found below. I am however getting an error. According to the intermediate window I have an "expected expression" error. Any help would be greatly appreciated.


    Please Login or Register  to view this content.
    Last edited by AnthonyWB; 05-04-2010 at 02:23 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Using VBA code to auto filter ?

    Looks like you have 3 criteria,you shouldonly have two
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Re: Using VBA code to auto filter ?

    royUK,

    I actualy need four criteria to be set. I have set Field to equal 2, since that is the column in which the criteria needs to be filtered.


    Please Login or Register  to view this content.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Using VBA code to auto filter ?

    two Criteria is the maximum,I believe

  5. #5
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Re: Using VBA code to auto filter ?

    Yep you are right, Any suggestions on how I can Filter or extract data from the spreadsheet based on multiple columns and several creiteria?

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Using VBA code to auto filter ?

    Basically as you would manually. Filter the data by one column, then filter by another or maybe you could use a Pivottable

  7. #7
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Re: Using VBA code to auto filter ?

    Thanks Roy,

    Where do I start in terms of VBA Code and pivot tables, since I woul d want to avoid this manually?

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Using VBA code to auto filter ?

    You need to attach an example workbook,without seeing your data layout & expected results it's all guess work

  9. #9
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Re: Using VBA code to auto filter ?

    Before we bang-out code, after creating the pivot table can we use VBA to request a data sheet of that particular pivot and save it to a specific file?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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