+ Reply to Thread
Results 1 to 17 of 17

Please Help - If then auto filter

  1. #1
    Registered User
    Join Date
    06-28-2018
    Location
    US
    MS-Off Ver
    2016
    Posts
    89

    Exclamation Please Help - If then auto filter

    Please please help, I have been trying to figure out this code all week and can not get the IF statement to work. It works without the If statement (highlighted in red) that is selecting only the rows that say "Jane Doe". Does anyone have any suggestions?

    I attached a workbook of what I want it to look like. The Full tab has the raw data and the new tabs has the data filtered out how I want it to be.

    This is the code I have right now.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    6,332

    Re: Please Help - If then auto filter

    With what you are trying you can go on for weeks.
    Do you have any idea what you're trying to do?
    The text
    Please Login or Register  to view this content.
    is entirely wroing and that combination does not exits in the table.
    I suggest you start over byt recording a macro and then carrying out the selection you want and use that for starters.
    The other sheets 'what you you want' is for now useless.
    Start fresh.
    Step 1 record a macro
    2. do the selections
    3. stop the recording

    then check the vba code.

    That attached file has no macros and the pasted code is well, bad.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    06-28-2018
    Location
    US
    MS-Off Ver
    2016
    Posts
    89

    Re: Please Help - If then auto filter

    The attached file was an example mock up.. not the one I am working in with my macro.

    I am new to this and am trying my best, you don't have to be so mean.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    6,332

    Re: Please Help - If then auto filter

    Sorry if I came across as mean, that was not my intention, sorry to have hurt your feelings.
    When I say record a macro, that's the way to start 'attacking' this type of issues and queries.
    That's the way 99% of us started, and VBA is nothin else than a series of line by line instructions respecting the correct syntax.
    So think of it like writing down what you want to achieve.
    If the value of this is that then do this else if the value is otherwise to something else.
    Now back to the 'mean' part.
    You state in your IF Ctrl = Jane Doe ext 44723
    Well first of all there is NO cell in your mock-up that contains that string, yes there is a Jane Doe but not anywhere anything vaguely point or referring to 44723

    So I suggest 'kindly' that you check what you post and ask because the data as you say it i s is not there.

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    6,332

    Re: Please Help - If then auto filter

    Except for Jane Doe's If statement that doesn't exist with the ext 44723
    If I understand your question correctly you want to copy the top 10 items of Column L, J and O to three different worksheets.
    Is this correct?
    Then say that, Please Help - If then autofilter does not at all reflect the question or what you're trying to do.
    Remember that when YOU ask a question about your file you are the one that knows what you want but try and explain it such a manner that an other person not at all knowing what you're trying needs to understand too.
    Yous tell me it my assumption is correct (that is if you still want this mean person to help you

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    6,332

    Re: Please Help - If then auto filter

    Three seprate macros to filter Jane Doe and the three columns, the worksheet is created on-the-fly, if you run the same macro again you will get an error because the name exists, you'll need code to check that and you can also add an input but to enter the client name to make it more dynamic

    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    5,124

    Re: Please Help - If then auto filter


    Why this duplicate thread ?‼ Do you test at least the code given in your previous thread ?

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013
    Posts
    16,932

    Re: Please Help - If then auto filter

    Rachel5694,

    Do you want it like this?
    Please Login or Register  to view this content.
    Last edited by jindon; 05-17-2019 at 08:18 PM. Reason: Fixed a typo

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    6,332

    Re: Please Help - If then auto filter

    Hi Jindon, Nice macro but your macro gets the 10 first rows sorted from higher to lower but that is different to the Top 10 ranking as the OP asked ... ?

  10. #10
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    5,124

    Exclamation


    As she already had a way in her previous thread

  11. #11
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    6,332

    Re: Please Help - If then auto filter

    To repeat her words, 'mean' ???

  12. #12
    Registered User
    Join Date
    06-28-2018
    Location
    US
    MS-Off Ver
    2016
    Posts
    89

    Re: Please Help - If then auto filter

    Hi jindon,

    I love this code! If I wanted to change it so the filtered data is pasted on the 13th row of each "New" sheet how would I change it to make this happen?

    Thank you!

  13. #13
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013
    Posts
    16,932

    Re: Please Help - If then auto filter

    Rachel5694,

    Try change to
    Please Login or Register  to view this content.
    Last edited by jindon; 05-21-2019 at 05:52 PM.

  14. #14
    Registered User
    Join Date
    06-28-2018
    Location
    US
    MS-Off Ver
    2016
    Posts
    89

    Re: Please Help - If then auto filter

    That works great thank you!!

    One more thing, the sheet that it is sorting the data and copying it from how can I make it start from line 2 instead of line 1?


    This code helped me so much, thank you.

  15. #15
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013
    Posts
    16,932

    Re: Please Help - If then auto filter

    Do you mean sort from row 15 in each New sheet?

  16. #16
    Registered User
    Join Date
    06-28-2018
    Location
    US
    MS-Off Ver
    2016
    Posts
    89

    Re: Please Help - If then auto filter

    I mean the data in the sheet "full" that is being sorted and copied starting at row 2 instead of row 1

  17. #17
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013
    Posts
    16,932

    Re: Please Help - If then auto filter

    Do you mean each new sheet already have header in row 13, so no need to copy header from "Full" sheet?
    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)

Similar Threads

  1. VBA - Auto Filter and make new sheets based on the filter values- Loop
    By Paul Cherian in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2017, 06:41 AM
  2. Auto refresh Auto filter excluding Zeros after chagnig date everytime
    By anwitha in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-08-2015, 08:09 AM
  3. [SOLVED] Auto Populate cell based on auto filter selection from table in same sheet
    By missydanni in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-02-2013, 05:03 PM
  4. Delete Rows hidden by either Auto Filter and Advanced Filter
    By lesoies in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2013, 10:29 AM
  5. [SOLVED] Advanced Filter results don't match auto filter
    By WaterWings in forum Excel General
    Replies: 1
    Last Post: 09-13-2012, 05:37 PM
  6. Auto Filter by InputBox - filter by user defined column
    By Originalgoth in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2010, 12:12 AM
  7. Replies: 1
    Last Post: 09-29-2005, 04:05 PM

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