+ Reply to Thread
Results 1 to 11 of 11

Auto filter macro

  1. #1
    Forum Contributor
    Join Date
    04-01-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    128

    Auto filter macro

    Hi,

    I have attached an excel file...I want a macro which would give me option to select the file from the directory and then auto filter as below:

    1) Filter Task status open and copy everything to sheet two.
    2) Then remove the filter and filter again to container number and select blanks and copy those data again to sheet two with the earlier data.
    3) Then i want it saved in the same directory where it was taken initially.

    NOTE: - if possible i need this macro to run in multiple files at a time as we get many files

    Thanks any help will be really really really really appreciated
    Attached Files Attached Files

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Auto filter macro

    Question on this part-
    2) Then remove the filter and filter again to container number and select blanks and copy those data again to sheet two with the earlier data.
    In your sample data, the 4th line shows as "Open" and it has a blank for container number. So as per step 1, it will already be copied. Then as per step 2, this same line will be copied again. Wont this be duplication?

    When you say the data should be copied along with the earlier data, should it be copied below or to the right side?

    Also, you said you want to run this macro on multiple files, so should the macro give the user a popup to open the file?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Contributor
    Join Date
    04-01-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Auto filter macro

    1) Yes it will be duplicated but both has to be copied as while working on it we filter on the shipment number.
    2) Data should be copied from the excel sheet to a newly created excel sheet.
    3) Yes macro should give the user a popup to open the file and if possible to select multiple files at a time to reduce time wastage

    Thanks for replying

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Auto filter macro

    Data should be copied from the excel sheet to a newly created excel sheet.
    Do you mean a new excel workbook or just a new sheet created in the same file?

    Yes macro should give the user a popup to open the file and if possible to select multiple files at a time to reduce time wastage
    You want the macro to open one file, then run the macro on it, then close it and open the next file right? Or do you want the user to run the macro each time they want to work on a particular file?

    Opening multiple files at one time will not help if you want the macro to work on all. It will have to open one file, run the macro, close the file, open the next file, etc.

    What do you suggest?
    Last edited by arlu1201; 08-16-2012 at 04:45 AM.

  5. #5
    Forum Contributor
    Join Date
    04-01-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Auto filter macro

    It should automatically open and do the filter thing and close...and again open...but i want the macro to give an option to the user to select on which all files does the macro will do this

  6. #6
    Forum Contributor
    Join Date
    04-01-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Auto filter macro

    Any updates bro ???....Thanks..

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Auto filter macro

    Do you want the macro to give the user a popup for each file that has to be opened?

    If there are too many such files, i would suggest, you keep all of them in one folder. The macro can then open each one, execute the steps, close it without having to ask the user to open each one.

  8. #8
    Forum Contributor
    Join Date
    04-01-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Auto filter macro

    Yes i need that popup! max to max there will be 35 files inside..... :-) and if at all more than that ....every file will be in one folder itself!

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Auto filter macro

    So you will need to choose between one of the 2 options which are - 1. Open through a popup for all files
    2. Open directly from folder without any popup.

  10. #10
    Forum Contributor
    Join Date
    04-01-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Auto filter macro

    First option is better...For ex if i have 35 files..I should get to choose which all files do i want...ok?

  11. #11
    Forum Contributor
    Join Date
    04-01-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Auto filter macro

    Any updates bro?

+ 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