+ Reply to Thread
Results 1 to 9 of 9

Filter Data and Format Results - VBA

  1. #1
    Registered User
    Join Date
    08-13-2017
    Location
    India
    MS-Off Ver
    365
    Posts
    7

    Filter Data and Format Results - VBA

    Hi All,

    Needed to read through multiple files, combine files and finally format data it in a specified format.

    I am able to combine the individual files and create a final XL, but unable to filter data and apply the data.

    Filter-Data.PNG

    Tried to record a macro but did not achieve the result.

    - Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Filter Data and Format Results - VBA

    With a pivot table.

    See the attached file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    08-13-2017
    Location
    India
    MS-Off Ver
    365
    Posts
    7

    Re: Filter Data and Format Results - VBA

    Thanks oeldere, But using a Pivot the final format is not achieved.

    Filter-Data-final-data.PNG

    for all methods.

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Filter Data and Format Results - VBA

    Hello
    Try this code .. I couldn't post the code directly
    Here's a text file with the code
    Attached Files Attached Files
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Filter Data and Format Results - VBA

    test to add code; can't add code at the moment (either).
    Last edited by oeldere; 08-13-2017 at 05:48 AM.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,242

    Re: Filter Data and Format Results - VBA

    It is because of the < and > characters - you need to add spaces either side of them.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Registered User
    Join Date
    08-13-2017
    Location
    India
    MS-Off Ver
    365
    Posts
    7

    Re: Filter Data and Format Results - VBA

    Hi Yasseer,

    Thanks that works on the sample data, but not sure when I put it into my final workbook.

    I am getting the error as Run-Time Error "9": Subscript out of Range at this line b(k) = x(i) in the code.

    Please advise.

    Thanks

  8. #8
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Filter Data and Format Results - VBA

    Hello
    I am not sure of the error but the code is working well on the sample you attached ..
    Please upload the sample workbook that the error occurred in to have a look

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,514

    Re: Filter Data and Format Results - VBA

    1) Change J1 from < /Types > to < /Type >
    2) Delete 1st row
    Please Login or Register  to view this content.
    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. Formula to filter results from data
    By iantix in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 04-11-2017, 10:36 AM
  2. Auto filter data and copy results to another worksheet?
    By thisiscrazy in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-24-2012, 07:46 AM
  3. Replies: 2
    Last Post: 02-03-2012, 12:13 PM
  4. Filter Results Shown In Data Validation List
    By Spencer in forum Excel General
    Replies: 19
    Last Post: 03-15-2011, 05:15 AM
  5. Data filter - count number of results
    By mdraper in forum Excel General
    Replies: 1
    Last Post: 09-01-2010, 11:40 PM
  6. Replies: 3
    Last Post: 03-31-2010, 11:47 AM
  7. Results of List of Data with Advanced Filter
    By vtphilk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-07-2008, 06:21 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