Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben
 
Posts: n/a
Default Alphabetical order possible? or not

Try this modification.

Either set your ENTER key to move right upon entry or use the Tab key to move
right out of column A to B

Enter last name in col A and first name in col B.

When you hit ENTER out of col B, A and B will sort by Last Name

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("B1:B100")) Is Nothing Then
With Target
If .Value < "" Then
Call Macro2
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub

Sub Macro2()
Range("A:B").Sort Key1:=Range("A1"), _
Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub


Gord

On Thu, 22 Jun 2006 10:20:50 -0500, OSSIE
wrote:

Hi and thnak you for your help
one more question on this last name and name have to be in the same
colum correct co is it possible to have the last name on column A and
the name on B ?


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
how can i re-sort multiple worksheets into alphabetical order Stuart Excel Discussion (Misc queries) 3 May 22nd 10 07:35 AM
How do I place items in alphabetical order in a column and keep da Angela33 Excel Worksheet Functions 7 March 16th 07 07:54 PM
why are my files out of alphabetical order? kwardja Excel Discussion (Misc queries) 2 June 19th 06 02:32 PM
Getting Pivot Tables to automatically sort rows in alphabetical order Kei Excel Discussion (Misc queries) 1 March 9th 06 05:24 PM
Using a macro to sort your data in alphabetical order? Carrie Excel Discussion (Misc queries) 1 April 14th 05 03:07 PM


All times are GMT +1. The time now is 12:58 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"