Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default VBA to sort list automatically in alphabetical order

Hi,

I am using a VBA to automatically update a source list I am using for
my data validation list as explained on the Ozgrid.com website:

http://www.ozgrid.com/Excel/excel-va...ist-update.htm

This allows the list to be automatically updated from the cells that
contain the data validation list - rather then having to go to the
source list itself. However, once the list is updated I would like it
to be automatically sorted by alphabetical order to save me time. Does
anyone know a VBA code for sorting in alphabetical order? My list is
on a seperate worksheet in column A.

Thanks for your help!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default VBA to sort list automatically in alphabetical order

Hi,

Make this the last line of the routine that updates the list

Columns("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending

Mike

" wrote:

Hi,

I am using a VBA to automatically update a source list I am using for
my data validation list as explained on the Ozgrid.com website:

http://www.ozgrid.com/Excel/excel-va...ist-update.htm

This allows the list to be automatically updated from the cells that
contain the data validation list - rather then having to go to the
source list itself. However, once the list is updated I would like it
to be automatically sorted by alphabetical order to save me time. Does
anyone know a VBA code for sorting in alphabetical order? My list is
on a seperate worksheet in column A.

Thanks for your help!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default VBA to sort list automatically in alphabetical order

On Oct 6, 7:10*pm, Mike H wrote:
Hi,

Make this the last line of the routine that updates the list

Columns("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending

Mike

" wrote:
Hi,


I am using a VBA to automatically update a source list I am using for
my data validation list as explained on the Ozgrid.com website:


http://www.ozgrid.com/Excel/excel-va...ist-update.htm


This allows the list to be automatically updated from the cells that
contain the data validation list - rather then having to go to the
source list itself. However, once the list is updated I would like it
to be automatically sorted by alphabetical order to save me time. Does
anyone know a VBA code for sorting in alphabetical order? My list is
on a seperate worksheet in column A.


Thanks for your help!


Hi Mike,

Thanks for your help!
The code worked, but I forgot to mention earlier my source list is on
another sheet - which I have named Data List.
Is there a way of making it sort the list on this sheet? As at the
moment it sorted the column A on the sheet where I have my data
validation.

Thanks!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default VBA to sort list automatically in alphabetical order

Hi,

Do it like this

With Sheets("Data List")
..Columns("A:A").Sort Key1:=.Range("A1"), Order1:=xlAscending
End With


Mike

" wrote:

On Oct 6, 7:10 pm, Mike H wrote:
Hi,

Make this the last line of the routine that updates the list

Columns("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending

Mike

" wrote:
Hi,


I am using a VBA to automatically update a source list I am using for
my data validation list as explained on the Ozgrid.com website:


http://www.ozgrid.com/Excel/excel-va...ist-update.htm


This allows the list to be automatically updated from the cells that
contain the data validation list - rather then having to go to the
source list itself. However, once the list is updated I would like it
to be automatically sorted by alphabetical order to save me time. Does
anyone know a VBA code for sorting in alphabetical order? My list is
on a seperate worksheet in column A.


Thanks for your help!


Hi Mike,

Thanks for your help!
The code worked, but I forgot to mention earlier my source list is on
another sheet - which I have named Data List.
Is there a way of making it sort the list on this sheet? As at the
moment it sorted the column A on the sheet where I have my data
validation.

Thanks!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default VBA to sort list automatically in alphabetical order

On Oct 6, 9:51*pm, Mike H wrote:
Hi,

Do it like this

With Sheets("Data List")
.Columns("A:A").Sort Key1:=.Range("A1"), Order1:=xlAscending
End With

Mike

" wrote:
On Oct 6, 7:10 pm, Mike H wrote:
Hi,


Make this the last line of the routine that updates the list


Columns("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending


Mike


" wrote:
Hi,


I am using a VBA to automatically update a source list I am using for
my data validation list as explained on the Ozgrid.com website:


http://www.ozgrid.com/Excel/excel-va...ist-update.htm


This allows the list to be automatically updated from the cells that
contain the data validation list - rather then having to go to the
source list itself. However, once the list is updated I would like it
to be automatically sorted by alphabetical order to save me time. Does
anyone know a VBA code for sorting in alphabetical order? My list is
on a seperate worksheet in column A.


Thanks for your help!


Hi Mike,


Thanks for your help!
The code worked, but I forgot to mention earlier my source list is on
another sheet - which I have named Data List.
Is there a way of making it sort the list on this sheet? As at the
moment it sorted the column A on the sheet where I have my data
validation.


Thanks!


Hi Mike,

Thanks that works!!
Sorry to be a pain - my knowledge in VB is very limited.
I have one more probelm. My data starts from A2. A1 is a heading.
I have been trying to make it to sort from A2 but it is not working.
Do you have any suggestions??

Thanks!


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default VBA to sort list automatically in alphabetical order

Add:

Header:=xlyes

To your sort statement.

..Columns("A:A").Sort Key1:=.Range("A1"), Order1:=xlAscending, header:=xlyes


wrote:

On Oct 6, 9:51 pm, Mike H wrote:
Hi,

Do it like this

With Sheets("Data List")
.Columns("A:A").Sort Key1:=.Range("A1"), Order1:=xlAscending
End With

Mike

" wrote:
On Oct 6, 7:10 pm, Mike H wrote:
Hi,


Make this the last line of the routine that updates the list


Columns("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending


Mike


" wrote:
Hi,


I am using a VBA to automatically update a source list I am using for
my data validation list as explained on the Ozgrid.com website:


http://www.ozgrid.com/Excel/excel-va...ist-update.htm

This allows the list to be automatically updated from the cells that
contain the data validation list - rather then having to go to the
source list itself. However, once the list is updated I would like it
to be automatically sorted by alphabetical order to save me time. Does
anyone know a VBA code for sorting in alphabetical order? My list is
on a seperate worksheet in column A.


Thanks for your help!


Hi Mike,


Thanks for your help!
The code worked, but I forgot to mention earlier my source list is on
another sheet - which I have named Data List.
Is there a way of making it sort the list on this sheet? As at the
moment it sorted the column A on the sheet where I have my data
validation.


Thanks!


Hi Mike,

Thanks that works!!
Sorry to be a pain - my knowledge in VB is very limited.
I have one more probelm. My data starts from A2. A1 is a heading.
I have been trying to make it to sort from A2 but it is not working.
Do you have any suggestions??

Thanks!


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default VBA to sort list automatically in alphabetical order

On Oct 6, 11:49*pm, Dave Peterson wrote:
Add:

Header:=xlyes

To your sort statement.

.Columns("A:A").Sort Key1:=.Range("A1"), Order1:=xlAscending, header:=xlyes





wrote:

On Oct 6, 9:51 pm, Mike H wrote:
Hi,


Do it like this


With Sheets("Data List")
.Columns("A:A").Sort Key1:=.Range("A1"), Order1:=xlAscending
End With


Mike


" wrote:
On Oct 6, 7:10 pm, Mike H wrote:
Hi,


Make this the last line of the routine that updates the list


Columns("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending


Mike


" wrote:
Hi,


I am using a VBA to automatically update a source list I am using for
my data validation list as explained on the Ozgrid.com website:


http://www.ozgrid.com/Excel/excel-va...ist-update.htm


This allows the list to be automatically updated from the cells that
contain the data validation list - rather then having to go to the
source list itself. However, once the list is updated I would like it
to be automatically sorted by alphabetical order to save me time. Does
anyone know a VBA code for sorting in alphabetical order? My list is
on a seperate worksheet in column A.


Thanks for your help!


Hi Mike,


Thanks for your help!
The code worked, but I forgot to mention earlier my source list is on
another sheet - which I have named Data List.
Is there a way of making it sort the list on this sheet? As at the
moment it sorted the column A on the sheet where I have my data
validation.


Thanks!


Hi Mike,


Thanks that works!!
Sorry to be a pain - my knowledge in VB is very limited.
I have one more probelm. My data starts from A2. A1 is a heading.
I have been trying to make it to sort from A2 but it is not working.
Do you have any suggestions??


Thanks!


--

Dave Peterson- Hide quoted text -

- Show quoted text -


Thanks soo much! That worked!!!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort in Greek alphabetical order jdc Excel Discussion (Misc queries) 2 December 6th 08 03:24 AM
sort last names by in alphabetical order Jackie Excel Discussion (Misc queries) 1 May 24th 06 08:45 PM
Getting Pivot Tables to automatically sort rows in alphabetical order Kei Excel Discussion (Misc queries) 1 March 9th 06 05:24 PM
Sort list into alphabetical order Jako[_18_] Excel Programming 1 June 12th 04 03:09 PM
Sort list into alphabetical order Jako[_17_] Excel Programming 0 June 12th 04 01:36 PM


All times are GMT +1. The time now is 01:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"