+ Reply to Thread
Results 1 to 10 of 10

Advanced Filter Macro Help

  1. #1
    Registered User
    Join Date
    07-07-2009
    Location
    San Francisco
    MS-Off Ver
    Excel 2003
    Posts
    16

    Advanced Filter Macro Help

    Hi,

    I am attempting to write a macro that takes data from a worksheet and sorts it into corresponding worksheets. Here is the code that seems to be troublesome:

    Please Login or Register  to view this content.
    I would like the code to sort through the data on Sheet4 and then copy the rows in the Multiline sector into the Multiline sheet.

    I have attached a workbook to help.

    Thanks in advance!
    Attached Files Attached Files
    Last edited by cdmcnamara; 07-10-2009 at 05:30 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Advanced Filter Macro Help

    Try this one:
    Please Login or Register  to view this content.
    Simply edit the "MyVal" string (in blue) and the same macro can be used to copy to any sheet that matches exactly.
    Last edited by JBeaucaire; 07-10-2009 at 02:47 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    07-07-2009
    Location
    San Francisco
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Advanced Filter Macro Help

    Thanks a lot, that works great but I have another question. So the list I will be working with is a huge list with many columns and rows and while this works with two columns, I was wondering if you can possibly tweak it so that it works based on a selection and all I have to do is specify what column to look for myVal in.

    Thanks for your help in advance!

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Advanced Filter Macro Help

    I can't picture what you mean. Sorry. Wouldn't it be easier to just work with a real sample workbook, with real, complete sample data and before/after examples to refer to?

    Like you did the first time, mock up a complete dataset this time showing what you want to do fully.

  5. #5
    Registered User
    Join Date
    07-07-2009
    Location
    San Francisco
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Advanced Filter Macro Help

    I apologize for the all the numbers in the sheet but its sensitive data, and I also had to take out some of the headings.

    The sheets indicate what the goal would be after I run the macro. I was hoping just to be able what to specify what header I want to sort by, ie. Sector, Edit Date, etc. and have it go through the whole data sheet and copy all the multilines over to the multiline sheet. Hope this helps.

    Thanks!
    Attached Files Attached Files

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Advanced Filter Macro Help

    Ah! So you just want it to parse out all the values to specific sheets, erasing original data and replacing it with the current data in the DATA sheet? Yes? Or keep the data on each sheet and ADD to the bottom each time it's run?

    I've got a bunch of those macros, pretty much ready-to-use.

  7. #7
    Registered User
    Join Date
    07-07-2009
    Location
    San Francisco
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Advanced Filter Macro Help

    Hey sorry I didn't specify more, the sheets in the multiline, banking, insurance sheets are what they would look like after the macro is ran, so initially they would be blank. I would also like to leave the data in the data sheet intact, so just copy it into the other sheets.

    Thanks!

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Advanced Filter Macro Help

    Like so to replace all existing data:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    07-07-2009
    Location
    San Francisco
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Advanced Filter Macro Help

    Works great, thanks.

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Advanced Filter Macro Help

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

+ 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