Auto Sort Columns and Fields

Copper Contributor

Hey Guys,

 

I am having a hard time finding the functionality (if it exists) on how to auto-sort columns/rows based on a template online; I am hoping you can help. At my employer, there are reports generated on a regular basis using an home-grown tool. Unfortunately, this tool does not export the date into excel into the exact format that I need to present my reports.

 

Is there a way to utilize an existing excel document to act as a template for a new excel document to auto sort or mimic the column layout? To give a rough example :

 

Say I have new excel document with columns  A, B, C, D, E and I want the output of D, B, E  (removing A and C) into a new document. Is there a formula or manner in which I can create this layout without manually modifying the excel document each time?

 

Any and all assistance that you can provide is greatly appreciated.

 

Sincerely,

 

Frustrated Excel user.

3 Replies

@jm12160 

 

Without seeing your actual examples, so just responding to your question and hoping I'm interpreting it adequately, I'd recommend you look into what Custom Views could do. Once you've set up a custom view, it can be accessed with a simple click. You see the menu item here, third from the bottom. Read up on its use in Excel Help.

mathetes_0-1586261591537.png

 

@mathetes 

 

Thank you so very much for your insight and quick response!

 

I am thinking that i might of poorly explained my scenario but I believe that you might be placing me on the right track. Using "Custom Views" would be quite beneficial in initially setting up my view and for reference in the future. However, what I am theoretically really trying to do is apply that created custom view to either a completely sheet in the same work document OR more ideally a completely different workbook. I'm not sure if this functionality exists utilizing either Macro, Formula or Views. I found a few articles that seem to indicate that what I am looking for can't be done using view (but as we know there are many untruths on the Internet). 

 

I have attached two files that hopefully will better explain. Both workbooks contain identical column names and overall format but different data. I want to manipulate the workbook to reflect the revised view (resorting columns, deleting columns etc.).  For this Example : Image A  = Initial Data  , Image B = Revised/Desired View to apply to different Sheets/Workbooks in the future.

 

Hopefully I did not just create additional confusion and my objective is clear.


Thank you again for your help and support on this matter. It is truly appreciated.

@jm12160 

 

I don't know that Custom View by itself would accomplish the kind of rearrangement your examples give, but (unless you're also doing calculations and modifying data simultaneously), it would be quite easy to add one step: which is to create columns that simply duplicate one or more of the columns, putting the duplicates in the sequence desired for View A, View B, View C...and then hiding or displaying them according to the need of the moment.

 

And, of course, it depends on how frequently you're updating data, getting new files (if from another source) that require re-formatting.

 

Without knowing the full context, if Custom View is not the solution, it occurs to me that we might just need a better, more complete understanding of the full flow of business here. What really is the whole context, what's the significance of a different arrangement of the columns? To use a somewhat crude expression, are we just "putting lipstick on a pig," messing with appearances when there's some deeper functionality needing to be addressed?