+ Reply to Thread
Results 1 to 11 of 11

Automatically sorting input data

  1. #1
    Registered User
    Join Date
    05-20-2020
    Location
    Berlin
    MS-Off Ver
    Office 365
    Posts
    5

    Automatically sorting input data

    I need some help with excel. I am not sure if what I am trying to achieve is doable with basic formulas or if VBA is needed.

    My idea is the following. I have one sheet that serves as a data input sheet. Another sheet is then supposed to pull information from the first sheet.
    I've added an overview in the attachment. Usually the sorted data would be shown in a different sheet than the input data.

    When the information is pulled, it should automatically get sorted. So all the names that are assigned to the number 1 are shown first. Then all the names that are associated with number 2 and so on. It is not predetermined how many names are associated with one number and this count can always change if a new entry is made.

    Is there a way to automatically sort the input data?

    Thank you for all ideas and/or solutions.
    Attached Images Attached Images

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Automatically sorting input data

    The following is based on your image where the NUMBER column is located in COLUMN F and the term NUMBER is located in F1 :

    Please Login or Register  to view this content.
    Paste the above in the SHEET module.

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Automatically sorting input data

    This can also be done with a pivot table.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Registered User
    Join Date
    05-20-2020
    Location
    Berlin
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Automatically sorting input data

    Pivot table is not an option unfortunately. There is more information and calculations that have to happen in the sorted data set

  5. #5
    Registered User
    Join Date
    05-20-2020
    Location
    Berlin
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Automatically sorting input data

    Thank you for your reply. Would you mind quickly explaining that piece of code to me, so I understand the thought process behind it and can adopt it in the future?
    If I paste your code, only column F gets sorted. How can I accomplish that's associated with that number sorts accordingly?

  6. #6
    Registered User
    Join Date
    05-20-2020
    Location
    Berlin
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Automatically sorting input data

    Quote Originally Posted by Logit View Post
    The following is based on your image where the NUMBER column is located in COLUMN F and the term NUMBER is located in F1 :

    Please Login or Register  to view this content.
    Paste the above in the SHEET module.
    Thank you for your reply. Would you mind quickly explaining that piece of code to me, so I understand the thought process behind it and can adopt it in the future?
    If I paste your code, only column F gets sorted. How can I accomplish that's associated with that number sorts accordingly?

  7. #7
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Automatically sorting input data

    .
    This will auto sort both columns when the date is copied to Sheet 2 :

    Please Login or Register  to view this content.
    If you are using formulas in F2:G20 to capture the data from Sheet 1, a different macro will most likely be required.

    Paste the above macro into SHEET2 module.

  8. #8
    Registered User
    Join Date
    05-20-2020
    Location
    Berlin
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Automatically sorting input data

    Yes, formulas are being used to grab the data from sheet 1. Why and what needs to be changed to still make this code work? Why do formulas interfere with this code?
    Last edited by alansidman; 05-21-2020 at 01:49 PM.

  9. #9
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Automatically sorting input data

    .
    Give the macro a try and verify that it works for you. I probably misspoke myself regarding how the macro works.

    My apologies.

  10. #10
    Forum Contributor
    Join Date
    03-29-2013
    Location
    lakewood, usa
    MS-Off Ver
    exce2013
    Posts
    112

    Re: Automatically sorting input data

    simonhg1, Here is a formula solution to the problem. It uses 3 helper columns(C-E). it concatenates the Number and Name then Ranks the result. Indexes the concatenated column(C); then splits the Number and Name. If data is going to be added consider using dynamic named ranges ' won' get in
    Attached Files Attached Files

  11. #11
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,924

    Re: Automatically sorting input data

    @simonhg1

    Please don't quote whole posts -- it's just clutter.*If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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. Automatic sorting data even if input is done with form
    By s7yzrs in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-19-2019, 11:43 AM
  2. [SOLVED] Macro Input Button for Data Sorting
    By msb15 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-28-2016, 08:10 PM
  3. Sorting a large amount of input data
    By Helo0931 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-04-2013, 01:31 PM
  4. Excel 2007 : Automatically Sorting Data
    By queniene in forum Excel General
    Replies: 1
    Last Post: 12-10-2008, 06:53 PM
  5. Macro to sum automatically data during input
    By Sam06 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-02-2007, 03:10 PM
  6. Replies: 2
    Last Post: 12-28-2006, 05:25 PM
  7. [SOLVED] Filter data automatically by input
    By Bunson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-28-2006, 03:30 PM

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