+ Reply to Thread
Results 1 to 6 of 6

Sorting and copying columns (Forms)

  1. #1
    Registered User
    Join Date
    05-04-2007
    Posts
    28

    Sorting and copying columns (Forms)

    Hi all, hope you can help me..

    I have a table with a defined number of columns, but where the rows will continually be increasing as new data is added.

    I want to create some forms where the user can choose which columns from the total list they wish to create a table from and which to sort by - ideally i want them to be able to select this from dropdowns or radio buttons.

    Then basically i want a copy of the original table to be produced on a separate tab only using the columns selected and sorted by the columns selected by the user.

    So to clarify, if the full table has the columns, age, name, date i want the user to be able to say 'i want a new table creating showing me just the columns age and date, sorted by date' and for this new table to go to a new worksheet with only the columns included they selected, leaving the original table in its original place unchanged.

    Any takers?! I'd be eternally grateful! I attach a hypothetical example so someone kind enough might add the functionality and i can then replicate on the proper version..
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    Is it just the columns Age and Date (assuming they are both chosen) that you want sorted, or do you want to allow for any of the chosen columns to be sorted?

    How many columns of data are there in your defined table?

    Rgds

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Dan,

    Does something like the attached help, or give you any ideas?

    Click the big green button to bring up the menu, then take it from there. The listbox on the left will be populated with however many fields you have on your data sheet. Once you've selected the ones you want, click the Extract button and the listbox on the right will be populated.

    Then select a field and choose the appropriate sort option, and finally click the sort button.

    HTH
    Attached Files Attached Files
    Last edited by Richard Buttrey; 08-02-2008 at 02:05 PM.

  4. #4
    Registered User
    Join Date
    05-04-2007
    Posts
    28

    Sorting and copying columns (Forms)

    Hi this is exactly what i needed, thankyou very much indeed.

    Is this going to be simple to copy across to another worksheet, I have no VB experience but am assuming a few tweeks to sheet names and ranges in the code once i copy across will be all that is needed?

    Thanks a lot,

    Dan

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi Dan,

    Yes it should be basically as simple as that. I used range names in the macro so you'll need to make sure you replicate those.

    Rgds

  6. #6
    Registered User
    Join Date
    10-17-2009
    Location
    Alabama
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Sorting and copying columns (Forms)

    Hi Richard,
    Your green button macro is great.How can I modify it to copy the selected columns to another workwork? I should be able to give the workbook a name and save it as well (a save msg box). I have another question. Is it possible to have a desktop icon which basicaly has the same function as your green button but it the process is invisible to the user. That is click the icon, input the excel file name, select the columns, type in the new workbook name and location (typical msg box save as).
    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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