Alphabetize Data

rockchalk33

Board Regular
Joined
Jan 12, 2016
Messages
111
Hey all,

Need a little help alphabetizing an unknown amount of data. I have a loop set to insert data at the bottom of a column. This data starts at cell A2 as cell A1 is simply a header. So my question is, how do I alphabetize data (this includes data starting with numerical values) starting at A2 instead of A1 and being able to do this with any arbitrary number of cells. A button will be utilized for doing this and the button is currently set up, I just am a little confused on the sorting code.

Thanks,

Devin
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Code:
column("A").sort key1:=range("A1"), header:=xlyes
 
Upvote 0
Code:
column("A").sort key1:=range("A1"), header:=xlyes

This code will be utilized after a loop in an already created Sub routine and thus when I put in your exact code I am getting a "Compile Error: Sub or Function not defined".
 
Upvote 0
Sorry:

Code:
column[COLOR="#FF0000"]s[/COLOR]("A").sort key1:=range("A1"), header:=xlyes
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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