+ Reply to Thread
Results 1 to 19 of 19

Find & Export: Is it possible? - Attached file now

  1. #1
    Registered User
    Join Date
    06-16-2012
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    58

    Find & Export: Is it possible? - Attached file now

    I have a worksheet or three full of names in one column, expenses & explanation in the next ones. They are grouped by month.

    Is it possible to have excel search/find a specific name and pull all occurrences for the full year, along with the data, and then export it to another worksheet?

    I suppose I could just arrange alphabetically, then manually copy/paste to another page, trying to automate it and look smart(er).
    Last edited by MrBurns; 08-04-2021 at 02:06 PM.

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: Find & Export: Is it possible?

    see big yellow banner - how to upload workbook.
    far easier to demonstrate on an actual workbook - the answer is yes it can be done.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Registered User
    Join Date
    06-16-2012
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    58
    I don't have the workbook as of yet.
    Despite web searching multiple keyword combinations, I couldn't find a way to do it.

    When I receive the sheets, I will attach a sample here.

  4. #4
    Registered User
    Join Date
    06-16-2012
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    58

    Attached example

    Attached example, the actual file is similar but may have more names or expenses, meaning that per month there may be 50 lines, with a claimant having from 1 to however many expenses.

    The intent is to have excel pull out any name with all its occurrences for however many months they appear during the year, including the expense nature and amount.
    Then if possible have that exported to a new sheet that would list per claimant instead of per month.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-16-2012
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    58

    Re: Find & Export: Is it possible? - Attached file now

    No takers yet?

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

    Re: Find & Export: Is it possible? - Attached file now

    Are you still running Excel Version 2007? If not, please update your profile as this will make a significant difference in what solution is offered. The more current your version, the more options available.
    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

  7. #7
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: Find & Export: Is it possible? - Attached file now

    The attached file has a small macro on the Worksheet_SelectionChange event.
    In column 'A' click in the blank cell adjacent to persons name - name appears in cell 'B1' - this triggers the code to filter/copy relative entries to second sheet.
    A far more elegant approach would be to use a single table with an extra 'date' column - filtering then becomes a simple task.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    06-16-2012
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    58

    Re: Find & Export: Is it possible? - Attached file now

    Quote Originally Posted by alansidman View Post
    Are you still running Excel Version 2007?
    Still on 2007.

  9. #9
    Registered User
    Join Date
    06-16-2012
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    58

    Re: Find & Export: Is it possible? - Attached file now

    The attached file has a small macro on the Worksheet_SelectionChange event.
    Interesting solution.

    A far more elegant approach would be to use a single table with an extra 'date' column - filtering then becomes a simple task.
    Not sure what you mean by that.


    How would I work it out so that the chosen name doesn't get overwritten by the next pick, short of copy/pasting the result to another sheet, which wouldn't be that terrible a chore.

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

    Re: Find & Export: Is it possible? - Attached file now

    FYI: Since you are still on 2007, I cannot offer you a solution. I had a Power Query solution for you but you will need to be on 2010 or later for that to work. Good Luck.

  11. #11
    Registered User
    Join Date
    06-16-2012
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    58

    Re: Find & Export: Is it possible? - Attached file now

    I'll take that solution if you don't mind, I can apply it to newer excel version.
    Last edited by AliGW; 08-07-2021 at 03:30 AM. Reason: PLEASE don't quote unnecessarily!

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,617

    Re: Find & Export: Is it possible? - Attached file now

    It would be helpful to let us know at the outset which version(s) of Excel the solution will be used on. What will that newer version be?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

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

    Re: Find & Export: Is it possible? - Attached file now

    Here is the PQ solution attached.

    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    06-16-2012
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    58

    Re: Find & Export: Is it possible? - Attached file now

    Here is the PQ solution attached
    Thanks!

    Wish I could see step-by-step into how the development process came by. It's one thing to be handed a solution, another to understand it.

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,617

    Re: Find & Export: Is it possible? - Attached file now

    One of us will talk you through it. I can't now as I have to go out shortly, but if Alan hasn't when I get back, I'll explain it.

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

    Re: Find & Export: Is it possible? - Attached file now

    1. Bring the first table into PQ Editor In 365 its, Data, Get and Transform, From Table/Range
    2. System automatically changes data type
    3. In editor, Filter out null rows in Column 1
    4. Remove all columns except 1, 3 and 5. Highlihgt those columns, select remove columns and then remove others
    5. Add a custom column that grabs column 1 if that column contains either January or February, otherwise place a null in the new column
    6. In the new column select Fill Down. PQ will replace all the nulls with either January or February
    7. Filter out the nulls in column 5
    8. Move the Month Column all the way to the left.
    9. Promote Row 1 to become your field names (headers)
    10. Rename column 1 to "Month"
    11. Create a new table containing the information in cells H1:H2
    12. Once in the PQ editor, right click on the value in row one and Drill Down.
    13. Close and load the new query to Connections
    14. In the claimant column filter for any value.
    15. Open the Mcode, Home Tab, Advance Editor
    16. Manually change the filtered value for the name of the new table.
    17. Close and load the original table to Excel.

    Any changes to the Claimant Table and then select in 365 on the Data tab, the refresh button.

    Look at this link for a tutorial on building parameter queries.

    https://www.youtube.com/watch?v=gK2yBpiITvI

  17. #17
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: Find & Export: Is it possible? - Attached file now

    Alternative - UserForm for data entry - if name or expense type not already listed then after you have typed it in once it will thereafter become available from drop-down.
    The right-hand side of form allows you to filter between dates for individuals - passing this onto USB for storage or to PDF for print out.
    The VBA is deliberately written longhand to make it more readable so that you can follow the code.
    The data is stored in one table - there are no on-sheet formula to bother about - depending on your Excel version you could store over 1 million rows.
    Attached Files Attached Files
    Last edited by torachan; 08-08-2021 at 03:17 AM. Reason: updated file

  18. #18
    Registered User
    Join Date
    06-16-2012
    Location
    Canada
    MS-Off Ver
    2019
    Posts
    58
    Updated to MS Office 2019. A whole decade newer.

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

    Re: Find & Export: Is it possible? - Attached file now

    Please update your profile.

+ 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. [SOLVED] Export opens in different format - can't find the reason
    By bweil in forum Excel General
    Replies: 9
    Last Post: 04-14-2021, 08:50 AM
  2. find a formulas export goods >0
    By ninhmoon in forum Excel General
    Replies: 6
    Last Post: 08-31-2015, 09:11 PM
  3. Code to export find and replace dialog box results
    By seExcelHelper in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-20-2015, 12:15 AM
  4. Select, find and export documents as PDF files
    By bthies in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-04-2013, 06:30 AM
  5. Find and export within cell
    By bigtwenty in forum Excel General
    Replies: 4
    Last Post: 12-26-2012, 05:03 PM
  6. Find and Replace cell Value on Export tab
    By Angela108 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-06-2012, 02:41 PM
  7. export find results
    By Amir in forum Excel General
    Replies: 2
    Last Post: 11-15-2005, 11:10 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