Sort by column header name?

mattyro1

Board Regular
Joined
Feb 10, 2009
Messages
96
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hello Mr. Excel participants,

By chance does anyone know how to sort by column header names?

I my VBA coding allows to grap data from two worksheets and consolidate into 1 named Summary. Example indicated below...Now I need to sort by column names. Example: Customer Name, Manager, Consultant Name...etc ect.

Can anyone lead me into the correct direction...???




Example:
Sub Sort_Sheets()
Sheets("Active").Range("A6:T500").Copy
With Sheets("Summary")
.Range("A1").PasteSpecial
Sheets("Cancelled").Range("A7:T500").Copy
Sheets("Summary").Range("A65536").End(xlUp).Select
Sheets("Summary").PasteSpecial
End With
End Sub
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
try recording a macro of using an autofilter and look at the code, you'll then be able to tweek it as needed.
 
Upvote 0
Thank you for your reply Upex...

Since I really only need this information sorted in order to populate into another worksheet, I simply used an IF statement with the appropriate columns needed.
 
Upvote 0
Sounds good as long as it's got the required results.
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,183
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top