+ Reply to Thread
Results 1 to 13 of 13

Sort and filter

Hybrid View

  1. #1
    Registered User
    Join Date
    05-08-2013
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2013
    Posts
    34

    Sort and filter

    Hello everybody!!!

    I have a spreadsheet with two sheets. The second sheet displays information from a number of columns in the first sheet using a simple formula. The first sheet has blank rows at the bottom so that it can be added to BUT, because the information is required to be displayed alphabetically, I've included a simple sort macro.

    Now it gets complicated.

    The second sheet is only required to show SOME entries from the first based on certain criteria [from the first] and I've included a simple filter macro. However, the second sheet will then have additional information, NOT required on the first, entered BUT, when the first sheet is sorted, the information already added to the second will then be in the wrong place.

    Attached is a simple spreadsheet hopefully showing the problem.

    Sheet1 lists (Columns B, C and D) the names, addresses and marital statuses of 16 people, sorted alphabetically. Sheet2 shows the same information using a simple formula AND ALSO the name of the spouse which isn't required to be shown on Sheet1. Clicking Button 2 on Sheet2 filters Sheet2 (Column D) to show only "Deb", "Mike" and "Vicky" and there respective spouses "John", "Jenny" and "Scott". However, if I then add "Bill", "1 The Crescent" and "No" on Row 20 on Sheet1 and then sort it alphabetically using Button 1, Sheet2 now shows "Colin", "Margaret" and "Tony" against the same spouses as shown previously. And then, when I filter Sheet2 using Button 2, "Deb", "Mike" and "Vicky" are shown again but their spouses aren't because they're now listed alongside "Colin", "Margaret" and "Tony".

    What I need, if it's possible, if for Column E (and all other Columns on Sheet2) to be sorted in conjunction which Sheet1.

    Thanks in advance.

    Ed
    Attached Files Attached Files
    Last edited by edmundo1971; 03-14-2016 at 07:19 AM.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Sort and filter

    Hi Ed,

    I suggest you attach a 'real' file not some text you expect everyone to copy and paste and then let us imagine what you have.
    A simple sample file with dummy data with what you have and what you want will suffice and make things easier to understand.
    ---
    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
    05-08-2013
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2013
    Posts
    34

    Re: Sort and filter

    Has it not attached properly???

    I've just tried to open it by downloading it and it worked fine.

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,941

    Re: Sort and filter

    Without knowing anything about what you use this workbook for or how you use it, it's difficult to make suggestions for fixing the issues you experience.
    I would however point out that you may be thinking this through the wrong way round. Would it not make sense to have one sheet that holds all possible information and then the other sheets with limited information populate from that sheet?

    You could have macros that filter this main sheet to the required rows and copy just the relevant columns to other sheets. By using VBA to paste values onto the other sheets rather than formulas to pull the data across you would be able to sort to your heart's content without worrying about data becoming out of sync.

    Just a thought...

    BSB

  5. #5
    Registered User
    Join Date
    05-08-2013
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2013
    Posts
    34

    Re: Sort and filter

    BadlySpelledBuoy

    Unfortunately, I cant attach the actual spreadsheet I'm working on as it contains some sensitive data. The one I hope I've attached correctly (please let me know if you too can't open it) is the best example I can come up to explain. Unfortunately I can't have all the information on the same sheet as the main sheet :-(

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,941

    Re: Sort and filter

    The file opens fine for me.
    I'm just puzzled as to what you're trying to accomplish.

    BSB

  7. #7
    Registered User
    Join Date
    05-08-2013
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2013
    Posts
    34

    Re: Sort and filter

    BadlySpelledBuoy,

    Ha, ha, ha - I know I'm rubbish at explaining things!!! I'm not even sure if it's possible given the restrictions I putting on it but I thought I'd better put it out there.

    As I've hopefully said, when Sheet1 is sorted, Sheet2 does the same but that's only because of the formulas (in certain columns). Its trying to ensure that the information entered manually also sorts at the same time to ensure it remains on the same row (if that makes sense).

    There has to be two sheets - I can't get around that for what's required as the information has to be kept separate.

  8. #8
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,941

    Re: Sort and filter

    You're going to struggle with that short of using VBA. Even then it wouldn't be a straightforward thing to do.

    BSB

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Sort and filter

    Just to see if I got you right.
    In principle both worksheets are identical except that data can only be added in Sheet1 and Sheet2 is used to display the data but filtered and always in alphabetical order?
    So along comes you funny boss and he/she enters new data but when sorting it will pop-up somewhere in an area already sorted but not (yet) visible in Sheet2 and you want the sheet to refresh, sort correctly and display the filtered values?
    It sounds more like somebody wants you off the streets

    Okay let me kwno if that's the main idea and I think I might have a simple solution (I hope)

  10. #10
    Registered User
    Join Date
    05-08-2013
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2013
    Posts
    34

    Re: Sort and filter

    Keebellah,

    Basically yeah.

    Everything would be fine if there wasn't a need to sort Sheet1 alphabetically every time a new entry is added. Personally, I can't understand why this is needed given that (a) Sheet1 can be filtered (the same name can be entered multiple times); and (b) the "Find" function works fine. But I work with idiots.

    Thanks again in advance.

    Ed

  11. #11
    Registered User
    Join Date
    05-08-2013
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2013
    Posts
    34

    Re: Sort and filter

    Keebellah/BadlySpelledBuoy,

    I'm closing the thread as solved as I've managed to convince my manager that having everything on one sheet gives a much better solution.

    Thanks for your input again!!!

    Ed

  12. #12
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Sort and filter

    It is a tough one, but it's good to be able to convince people that sometimes reconsidering is an option.
    I had something but it messed it all up, so, thanks for letting us know.
    If I do get it to work I'll post it to you anyway, who knows you'll get a promotion

  13. #13
    Registered User
    Join Date
    05-08-2013
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2013
    Posts
    34

    Re: Sort and filter

    Thanks you my friend!!!

+ 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. Can't Sort or Filter
    By JXBlack in forum Excel - New Users/Basics
    Replies: 12
    Last Post: 10-25-2017, 01:35 AM
  2. I can't sort using my filter
    By MiriBella in forum Excel General
    Replies: 5
    Last Post: 06-19-2014, 10:40 PM
  3. Filter and Sort
    By siobeh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-03-2014, 04:55 AM
  4. How to filter then do sort
    By gammaman in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-15-2012, 01:09 PM
  5. Sort/filter
    By cowboy713 in forum Excel General
    Replies: 6
    Last Post: 11-22-2010, 06:40 PM
  6. Sort and Filter
    By prodgerson in forum Excel General
    Replies: 1
    Last Post: 07-11-2010, 02:01 AM
  7. Filter with Sort
    By CobraLAD in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-13-2009, 05:14 AM

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