+ Reply to Thread
Results 1 to 12 of 12

Transfer Names to List and Sort A-Z

  1. #1
    Registered User
    Join Date
    03-18-2010
    Location
    Layton, UT
    MS-Off Ver
    Excel 2013
    Posts
    73

    Transfer Names to List and Sort A-Z

    In the attached workbook, you can click the "Add a Name" button to open form. Once a list (INCOME, EXPENSE, or MISC) is selected in the combobox, up to 3 names can be entered in the textboxes. Then by clicking TRANSFER the names are transfered and added to the list in columns A (INCOME), B (EXPENSE), or C (MISC).

    Currently everything works fine, but instead of the names being pasted into columns A, B, or C, I wish for them to be pasted into column D, F, and H, starting at row 10 or the next available row. I have the column headers in D8, F8 and H8, with row 9 blank. However, headers can be place in row 9, if necessary.

    Finally, once the names are pasted to the selected list, I want the list to AutoSort, A to Z.

    Thanks in Advance for Your help
    Attached Files Attached Files
    Last edited by catnam; 03-03-2021 at 11:01 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    Re: Transfer Names to List and Sort A-Z

    Please Login or Register  to view this content.
    Named ranges used:
    Expense =Sheet2!$F$8
    Income =Sheet2!$D$8
    Misc =Sheet2!$H$8
    Last edited by protonLeah; 03-10-2021 at 01:34 AM. Reason: forgot to sort list
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    03-18-2010
    Location
    Layton, UT
    MS-Off Ver
    Excel 2013
    Posts
    73

    Re: Transfer Names to List and Sort A-Z

    Thanks Ben for the code.
    I've placed it into my form code. See new workbook attached.

    However, for some reason there is an error at this line of code:
    NextListItemRow = Cells(Rows.Count, Range(ListText).Column).End(xlUp).Row

    Also,I see a SortRng1 and SortRng2, if these refer to two of my lists, should there also be a SortRng3?
    Attached Files Attached Files
    Last edited by catnam; 03-11-2021 at 07:33 AM.

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Transfer Names to List and Sort A-Z

    Here is the code
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Registered User
    Join Date
    03-18-2010
    Location
    Layton, UT
    MS-Off Ver
    Excel 2013
    Posts
    73

    Re: Transfer Names to List and Sort A-Z

    Thanks kvsrinivasamurthy,

    Here is the workbook I'm trying to put your code into.
    The code is in the form module
    I wish to have the names that are entered into the form textboxes, copied, pasted and sort on the NAMEMANAGER sheet.
    Pasted and sorted in D10:D200 for INCOME, F10:F200 for EXPENSE, and H10:H200 for MISC

    *** To return menu bars, minimize the workbook first by click hash/dash in upper right corner, then maximinze.

    Thanks
    Attached Files Attached Files
    Last edited by catnam; 03-20-2021 at 03:37 PM. Reason: To add workbook

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Transfer Names to List and Sort A-Z

    Code edited. It is working now ok.
    You referring to sheet as sheet33. It is not a good practice. It will be very difficult to edit or view working.
    Instead it is good to refer the same sheet as Sheets("NAMEMANAGER")
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-18-2010
    Location
    Layton, UT
    MS-Off Ver
    Excel 2013
    Posts
    73

    Re: Transfer Names to List and Sort A-Z

    Thanks again and I do appreciate your patience.
    The code does indeed work, but only if the "Open EditName Form” button, that you added, is on the NAMEMANAGER sheet. I would like for this button to be on each budget sheet.
    Currently, if I click existing “Name Manager” button, on any budget, the same EditName form opens; or if I copy your “Open EditName Form” button to JAN budget and click it the same EditName form opens. However, in both cases sorting does not take place correctly, as it does when I click the “Open EditName Form” button, on the NAMEMANAGER sheet.
    If you can, please make “Open EditName Form” button (or existing Name Manage buttons on budgets) work from JAN and other budgets. If possible, just add to JAN and I will copy paste it to the other budgets.
    Thanks so much.

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Transfer Names to List and Sort A-Z

    Code revised.
    I have put button in Jan sheet. Working ok. Similarly copy button to all required sheets
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 03-22-2021 at 12:19 AM.

  9. #9
    Registered User
    Join Date
    03-18-2010
    Location
    Layton, UT
    MS-Off Ver
    Excel 2013
    Posts
    73

    Re: Transfer Names to List and Sort A-Z

    The code seems to work.

    Thanks

    Catnam
    Last edited by catnam; 03-24-2021 at 02:29 PM.

  10. #10
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Transfer Names to List and Sort A-Z

    Code was not working for NAMEMANAGER sheet. I modified code. It works for all sheets
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    03-18-2010
    Location
    Layton, UT
    MS-Off Ver
    Excel 2013
    Posts
    73

    Re: Transfer Names to List and Sort A-Z

    Thanks for the fix, but the code is very tempermental.

    I noticed you added module 45 with Sub OpenFormEditName code, to open the form.
    This always work in my larger file.

    Also I see the added code (in cmdTransfer button) in the form module, which I suppose is to copy, paste and sort the names on NAMEMANAGER sheet.

    However, whenever I create a module 45 in my larger file, add a shape to JAN, then link module 45 code to said shape, then change the appropriate sheet name to NAMEMANAGER, then copy the form and cmdTransfer button code to larger file, wiht no changes except sheet name, it does not work. It goes through all the motions, without any error messages, but nothing appears on the NAMEMANAGER sheet. I've checked the spelling of the name multiple times, at each place it appear in the code.

    Did you add code to any other modules?

  12. #12
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Transfer Names to List and Sort A-Z

    Module 45 for opening the userform is added. Userform code edited as per your requirement. I haven’t added or changed any code.

+ 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] How to Sort or move list of preferred names
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-31-2019, 04:38 PM
  2. sort the list of names based on the group
    By protocoder in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-26-2018, 08:25 AM
  3. [SOLVED] Sort List of names
    By nicolaforni in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-20-2012, 04:55 AM
  4. Sort list of names by surname
    By BVan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-29-2008, 02:31 PM
  5. List of names sort
    By mmednick in forum Excel General
    Replies: 3
    Last Post: 08-15-2006, 08:00 PM
  6. [SOLVED] How do I randomly sort a list of names?
    By JIreland in forum Excel General
    Replies: 3
    Last Post: 05-17-2006, 02:45 AM
  7. how do i transfer a spreadsheet list of names onto an document
    By fwt in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-03-2005, 10:05 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