Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1
Default how to auto arrange in alphabetical order-excel sheet

how to auto arrange in alphabetical order-excel sheet after typing names in
random?
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,058
Default how to auto arrange in alphabetical order-excel sheet

Let's say we are entering data in column A and we want to alphbetize the
column as entries are made. Try the following macro:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Range("A:A"), Target) Is Nothing Then
Exit Sub
End If
Range("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub

This goes in worksheet code:

1. right-click the tab name at the bottom of the window
2. select View Code - VBE window will open
3. paste the macro in the VBE window and then just close the VBE window
--
Gary's Student
gsnu200704


"subha" wrote:

how to auto arrange in alphabetical order-excel sheet after typing names in
random?

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 22,906
Default how to auto arrange in alphabetical order-excel sheet

As Dave Peterson has pointed out a few times, this may not be a good idea.

Reason.............perhaps a spelling mistake is made on last entry.

Before user can correct it after hitting ENTER, that entry has been sorted to
who knows where.

A manual DataSort might be better after a check for proper entry.


Gord Dibben MS Excel MVP

On Thu, 8 Feb 2007 11:05:01 -0800, Gary''s Student
wrote:

Let's say we are entering data in column A and we want to alphbetize the
column as entries are made. Try the following macro:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Range("A:A"), Target) Is Nothing Then
Exit Sub
End If
Range("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub

This goes in worksheet code:

1. right-click the tab name at the bottom of the window
2. select View Code - VBE window will open
3. paste the macro in the VBE window and then just close the VBE window


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
Can We Arrange Multiple Sheets of Excel File in Alphabetical Orde Arranging Multiple Sheets of Excel File Excel Discussion (Misc queries) 2 December 18th 06 12:39 PM
Sum up columns in different sheet with error check zeyneddine Excel Discussion (Misc queries) 13 July 10th 06 01:21 PM
how do I set up a excel spreadsheet to auto sort data in order jason Excel Discussion (Misc queries) 0 January 3rd 06 07:17 PM
Getting Excel Data from One Sheet to Another.... Robin Excel Discussion (Misc queries) 2 April 21st 05 01:15 PM
how do i arrange column A (last name) in alphabetical order? t. hershy Excel Discussion (Misc queries) 2 November 28th 04 10:23 PM


All times are GMT +1. The time now is 12:49 AM.

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

About Us

"It's about Microsoft Excel"