+ Reply to Thread
Results 1 to 5 of 5

Macro to filter active ws in workbook and paste filtered result in "result" worksheet

  1. #1
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Macro to filter active ws in workbook and paste filtered result in "result" worksheet

    I am trying without success to create a macro that will display filtered results in another worksheet. Attached is a copy of the file scenario. There are several macro attempts within the file but I cannot seem to set autofilter ranges

    Basically for tyhe activesheet in workbook (except control sheet) the range a3 to last entry in column s or t needs to be filtered by column 3 with the criteria1 being "M" (for major work)
    That filtered result would need to be pasted to the next available row in worksheet result, and then the autofilter to be turned off

    explanation repeated in control sheet of workbook attached
    Any help would be appreciated


    I posted a different approach to the same problem in the Excel 2007 by mistake, and have been unable to remove, I hope the moderators will overlook this as I have tried to contact them to remove the post so I could repost here in the programming section

    Many thanks Nigel
    Attached Files Attached Files
    Last edited by nigelog; 05-24-2012 at 12:02 PM. Reason: solved by myself

  2. #2
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Macro to filter each worksheet in workbook and paste filtered result in "result" works

    Hi
    I have got as far as filtering the worksheet but have a problem. I need to copy only a few of the columns to another worksheet.

    Is it possible to select specific areas of a filter result up to the last entry, or would it be better to copy this to an interim worksheet, delete the necessary columns, then copy onto the destination.

    In the attached workbook "Macro2" will filter the data as required

    worksheet "result" displays in yellow what needs to be copied

    worksheet "result2" shows the information I require to paste to a different location.

    Any help would be appreciated

    Code of Macro2 so far
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by nigelog; 05-23-2012 at 07:22 AM.

  3. #3
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Macro to filter each worksheet in workbook and paste filtered result in "result" works

    Getting nearer - have decided to copy filtered results from the active worksheet, rather than all sheets in workbook to simplify.

    Code attached now filters selection as I want - and selects the data I require from the filter -

    but I cant move it from there to the results sheets to delete columns before pasting to another workbook

    am I doing something that it is stopping this from happening - any help appreciated - (run this macro in sheet 05c127860 of costing file from previous post to see result)

    Please Login or Register  to view this content.
    Last edited by nigelog; 05-23-2012 at 12:09 PM.

  4. #4
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Macro to filter each worksheet in workbook and paste filtered result in "result" works

    this now works for active worksheet (I decided on this as operator will see major work and update to other file accordingly)

    how can I turn off autofilter at end of routine, I have tried several ways - macro works in vehicle costing workbook above

    Please Login or Register  to view this content.
    Last edited by nigelog; 05-24-2012 at 11:21 AM.

  5. #5
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Macro to filter each worksheet in workbook and paste filtered result in "result" works

    Added rng.AutoFilter to solve that problem

    with this code, rather than copying to an interim sheet "results", I am going to try to copy range data to a worksheet , the same name as the active worksheet in another workbook

    I can see this thread has caused little interest LOL





    Please Login or Register  to view this content.

+ 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