+ Reply to Thread
Results 1 to 17 of 17

VBA - Custom Filter

  1. #1
    Registered User
    Join Date
    11-25-2008
    Location
    Dublin, Ireland
    Posts
    10

    VBA - Custom Filter

    I have a bit of a weird one - -- --- -- -- --

    I have a huge spreadsheet with a list of Pay Periods in Column A (e.g. 200834) and Employee IDs in Column B (e.g. 3007).

    Columns C - ZZ contain figures, which are grouped into 3-5 column-wide blocks or related data. For example Columns E-G all contain tax data for a specific Employee in that specific Pay Period.

    What I want (need really) is a filter that lets me input a period number and a range of columns.

    The resulting columns (e.g. A-B AND E-G) then need to be copied to a new sheet.

    It would be amazing if I could also specify a sheet name in the filter.

    There's one other complication.

    The values on the sheet (which is sheet 1 of the WB) are generated via formulas on sheet 2 of the same WB.

    So, if I select a value on sheet two I actually see something like "='SETUP-TRESHOLDS-VARIABLES'!$K$8" in the Formula Bar; the cell however contains the resulting data (in that case 500.00).

    Any ideas?

    I'm in 2007 if that matters. (I've seen contradictory thoughts on that, btw.)

    Thanks so much guys and gals and help is mucho appreciado.

    --

    BTW> I have tried doing this about 10 different ways, cannibalizing other script, etc... but due to the dynamic nature of the data, nothing has worked...

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Why don't you just keep all the data on one sheet but use Custom Views to see relevant data?
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    11-25-2008
    Location
    Dublin, Ireland
    Posts
    10

    because

    thanks for the response...

    we're parsing out the bits to different people who "don't need" to have access to the rest of the data and we're also stripping out the results into separate csv files for import...

    does that make sense?

    thanks!!!

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    It would still be easier to use one sheet for data
    Last edited by royUK; 11-25-2008 at 10:28 AM.

  5. #5
    Registered User
    Join Date
    11-25-2008
    Location
    Dublin, Ireland
    Posts
    10
    will that make it impossible?

    we need to be able to globally update some of that data on the other sheet...so that's why... I suppose I could always just save the data sheet independently.. if that would help, consider it done!!!

    whatever it takes...

    --

    EDIT:

    I have created a single sheet version... can I post that here somehow
    Last edited by leelikchi; 11-25-2008 at 11:30 AM. Reason: I didn't want to double post.

  6. #6
    Registered User
    Join Date
    11-25-2008
    Location
    Dublin, Ireland
    Posts
    10
    wow! I'm amazed... I just tried a good excel programmer I know and they told me they couldn't do it...

    is this really that difficult?

    should I try and get a developer here to spend some time on it?

    shows what I know :P

  7. #7
    Registered User
    Join Date
    11-25-2008
    Location
    Dublin, Ireland
    Posts
    10
    still no answer?

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    It's difficult to help without seeing an example of the layout

  9. #9
    Registered User
    Join Date
    11-25-2008
    Location
    Dublin, Ireland
    Posts
    10
    Quote Originally Posted by royUK View Post
    It's difficult to help without seeing an example of the layout
    D'oh!

    thanks Roy!!!

    I have attached the spreadsheet..


    does that help ?



    I really wasn't trying to be a jerk, just trying to figure out if it's something I need to spend developer resources on, etc.

    :P
    ----------------
    Now playing: Dead Letters Spell Out Dead Words / This Room Seems Empty Without You
    Attached Files Attached Files

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    It's still not very clear, do you want to filter the period & copy the data for that period?

    I filter for 200804

    Col B contains data P, Q & R

  11. #11
    Registered User
    Join Date
    11-25-2008
    Location
    Dublin, Ireland
    Posts
    10
    Quote Originally Posted by royUK View Post
    It's still not very clear, do you want to filter the period & copy the data for that period?

    I filter for 200804

    Col B contains data P, Q & R
    Sorry Roy, you're a saint for being so patient.

    Yes, I want to be able to say 200804, Rows A-B, and J-L (for example).

    This would take all rows with the date 200804 (so like 100 rows) and copy and paste the data from those specific columns into a new workbook... or even better a new .csv document... but a new workbook/sheet is totally cool...

    heck, even just a new worksheet in the same workbook is super cool... I just have to do this all the time and it's so incredibly tedious + I have to show a few other this ridiculous task... and they always screw it up...

    so if I could make this easier for all of us (and produce a more trustworthy result) I would be so relived...

    thanks again Roy!!



    ----------------
    Now playing: Modest Mouse / Third Planet (Demo)

  12. #12
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Do you need to keep the same format, with empty columns or just the columns containing data?

  13. #13
    Registered User
    Join Date
    11-25-2008
    Location
    Dublin, Ireland
    Posts
    10
    same format please ... sometimes those column DO have data.... pain huh?

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

    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    11-25-2008
    Location
    Dublin, Ireland
    Posts
    10
    Quote Originally Posted by royUK View Post
    Try this

    Please Login or Register  to view this content.
    trying now....

    ok...

    well..

    that didnt' seem to work.

    it definitely does do half of it, but I probably (as usual) wasn't explicit...

    --

    In other words

    --

    Can I choose which columns I want to copy onto the new worksheet at runtime?

    And...

    Can I use the yyyymm format instead of the ddmmyy format for dates (just to mimic the existing date format)?

    Aren't I a jerk
    Last edited by leelikchi; 12-01-2008 at 12:12 PM.

  16. #16
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I'm not sure how you would know which columns you need.

  17. #17
    Registered User
    Join Date
    11-25-2008
    Location
    Dublin, Ireland
    Posts
    10
    Quote Originally Posted by royUK View Post
    I'm not sure how you would know which columns you need.

    I need to be able to enter them at runtime... otherwise I'd need several versions...

    For instance... one is A-J, one is A-B + K-M, one is A-B + N-O, etc. etc.

    ("-" means through not minus, btw.)

    It would be cool if there was a way to make presets etc., but there probably isn't... so if I could just say (for example):

    year = 200805
    Columns = a-b, n-o
    name = xrima tpl.csv

    and it would generate a .csv called "xrima tpl" that had every row that had 200805 in Column A with the data from columns a, b, n, m and o.

    Does that make sense?

    So I could choose this stuff at run time every time...

    That's what makes this all so tricky... the super-advanced bit

    Thanks for soldiering on Roy... I really genuinely appreciate it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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